Class EditorMethodReference

All Implemented Interfaces:
EventListener, IGProp<String>, Cloneable

public class EditorMethodReference extends MethodReference
The Designer version of the Method Reference property class hold the reference to a Method that is in a Java class. This Java class reference "ClassReference" is held by a parent container in the tree. It includes support for Java Refactoring in Eclipse as well as Reference Validation.
Christopher Mindus
  • Field Details

  • Constructor Details

    • EditorMethodReference

      public EditorMethodReference()
      Creates a Method Reference property with no name and with a null value.
    • EditorMethodReference

      public EditorMethodReference(Atom propertyAtom)
      Creates a Method Reference property with the specified name with a null value.
      propertyAtom - the property atom.
    • EditorMethodReference

      public EditorMethodReference(Atom propertyAtom, String newValue)
      Creates a Class Reference property with the specified name and value.
      propertyAtom - the property atom.
      newValue - the new string value for the property.
  • Method Details

    • setRequiredAnnotation

      public void setRequiredAnnotation(String requiredAnnotation)
      Assigns a fully qualified annotation name that the Java Class should be annotated with.

      Setting the annotation name doesn't cause a property change.

      requiredAnnotation - The annotation required, or null for none.
    • getRequiredAnnotation

      public String getRequiredAnnotation()
      Get the fully qualified annotation name that the Java Class should be annotated with.
      Gets the required annotation name, null for none.
    • onEventSelf

      public void onEventSelf(GEvent event)
      Event processing for Java Class Reference changed.
      Specified by:
      onEventSelf in interface IGProp<String>
      onEventSelf in class GProp<String>
      event - The property event.
    • onReferenceEvent

      protected void onReferenceEvent(ResolveReferencesEvent event)
      Called to perform reference resolving. A property should override this method if it needs to perform reference resolving and validation.

      Subclasses override this method and only subclasses extending PropCnr needs to call super.onReferenceEvent(ResolveReferenceEvent event).

      onReferenceEvent in class GProp<String>
      event - The resolve references event.
    • getJavaClass

      public static JavaClass getJavaClass(PropCnr methodReferenceParent)
      Gets the JavaClass (IClassReference) from a parent.
      null if not found.
    • getClassReferenceOwner

      public static IClassReferenceOwner getClassReferenceOwner(PropCnr methodReferenceParent)
      Gets the ClassReference parent that SHOULD or COULD hold the ClassReference for a MethodReference.
      null if not found.
    • getClassReference

      public static EditorClassReference getClassReference(PropCnr methodReferenceParent)
      Gets the ClassReference property from a parent.
      null if not found.
    • resolve

      public MethodLookup resolve()
      Resolves the reference.
      The method Object (IMethod for Designer), or class/type instance (IType for Designer) if class is present but not the method, or a String for the error (can also be null e.g. for no method name). Do not use the return code in other places than the Designer.
    • getJavaElement

      public org.eclipse.jdt.core.IJavaElement getJavaElement()
      Gets the Java element in resolve, could be a IType or IMethod (even the wrong IMethod due to missing annotation or compile error). This should only be used e.g. in the Show in Java Editor function.
    • isAnnotationMissing

      public boolean isAnnotationMissing()
      Checks for missing annotation. This call should only be used in the Designer.
      null For not missing or can't do anything, otherwise the JavaClass instance.
    • onPropDispose

      protected void onPropDispose()
      Called when a property is disposed of.
      onPropDispose in class GProp<String>