Class Selector

All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, IReferencingPropCnr, ISelectorExpression, Cloneable
Direct Known Subclasses:
EditorSelector

public class Selector extends PropCnr implements ISelectorExpression, IReferencingPropCnr
The Selector class is used to enable or disable participants such as panels, text tables and translation tables, perhaps images.
  • Field Details

    • EMPTY

      public static final Selector[] EMPTY
      Empty array of selectors.
  • Constructor Details

    • Selector

      public Selector()
      Creates the Selector property container without a name. The name must be set in all cases using the setPropertyAtom call.
    • Selector

      public Selector(Atom propertyAtom)
      Creates the Selector property container with the specified name. All system-reserved names for components begins with "$".
      Parameters:
      propertyAtom - the name of the component, unique within it's parent.
  • Method Details

    • clone

      public Selector clone()
      Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.
      Overrides:
      clone in class PropCnr
    • onEventSelf

      public void onEventSelf(GEvent event)
      Checks for expression changes to define references.
      Specified by:
      onEventSelf in interface IGProp<GProp<?>[]>
      Overrides:
      onEventSelf in class GProp<GProp<?>[]>
      Parameters:
      event - The property event.
    • onPropParentChanged

      protected void onPropParentChanged(PropCnr oldParent, PropCnr newParent)
      Verify when loaded/created.
      Overrides:
      onPropParentChanged in class GProp<GProp<?>[]>
      Parameters:
      oldParent - The old parent (or null if none).
      newParent - The new parent (or null if none).
    • isSelected

      public boolean isSelected(EnvProps envProps)
      Called to resolve the SelectorExpression.

      This method will return false if there are errors present in the Selector such as circular or unresolved references.

      Specified by:
      isSelected in interface ISelectorExpression
      Parameters:
      envProps - The Client Environment properties.
      Returns:
      true if the Selector is selected to be used and does not contain errors, false otherwise.
    • createSelectorExpression

      protected SelectorExpression createSelectorExpression(String expression)
      Creates the SelectorExpression, overridden by the Designer version of the class.
      Parameters:
      expression - The reference.
    • createClassReference

      protected ClassReference createClassReference(Atom atom, String ref)
      Creates a ClassReference, overridden by the Designer version of the class.
      Parameters:
      atom - The atom name.
      ref - The reference.
    • createSelectorReference

      protected SelectorReference createSelectorReference(Atom atom, String ref)
      Creates a SelectorReference, overridden by the Designer version of the class.
      Parameters:
      atom - The atom name.
      ref - The reference.
    • getSelectorExpression

      public SelectorExpression getSelectorExpression(boolean doParse)
      Gets the selector expression. If the expression already has been parsed successfully, that expression instance is returned.
      Parameters:
      doParse - Flag to return the expression parsed, with error logging.

      Note: if the expression cannot be parsed, null is returned.

      Returns:
      The selector expression if it defined and can be parsed, null otherwise.
    • getJavaClassInstance

      public ISelectorExpression getJavaClassInstance(String className)
      In Server run mode, gets the class name instance object created. If the class name is not found in the references or by resolving the class name, an error is logged.
      Parameters:
      className - The class name.
      Returns:
      The instance, or null for failure.
    • getReferenceType

      public IPropReference.IRefType getReferenceType()
      Gets the reference Type.
      Specified by:
      getReferenceType in interface IReferencingPropCnr
      Returns:
      IPropReference.RefType.Selector.
    • usesMultipleReferencing

      public boolean usesMultipleReferencing()
      Checks if this referencing Property Container has single or multiple referencing properties at maximum.
      Specified by:
      usesMultipleReferencing in interface IReferencingPropCnr
      Returns:
      Always true for multiple references to retrieve the referencing properties using the method getReferencingProps().
    • getReferencingProp

      public IReferencingGProp getReferencingProp()
      Gets the single potential instance of a referencing property instance.
      Specified by:
      getReferencingProp in interface IReferencingPropCnr
      Returns:
      Always null as there is no single referencing property. Use the method getReferencingProps() to retrieve the referencing properties.
    • getReferencingProps

      public IReferencingGProp[] getReferencingProps()
      Gets the array of referencing property instances.
      Specified by:
      getReferencingProps in interface IReferencingPropCnr
      Returns:
      The array of referencing properties, or null none is found. The array may also be empty.
    • onExpressionChanged

      protected void onExpressionChanged(SelectorExpression expression)
      Called when the expression has changed.
    • getSelectorReferences

      public SelectorReference[] getSelectorReferences()
      Gets the target Selector references for this Selector.
      Returns:
      The target Selector references or null if not found.
    • verify

      public boolean verify(PropVerification verification)
      Verifies this property container. The check performed is the extension of classes and that no circular reference is present.
      Specified by:
      verify in interface IGProp<GProp<?>[]>
      Overrides:
      verify in class PropCnr
      Parameters:
      verification - The property verification class.
      Returns:
      true if verification should proceed, false if disposed of and verification should not take place.