Class SelectorReference

All Implemented Interfaces:
EventListener, IGProp<ReferenceString>, IPropReference, IReferencingGProp, Cloneable
Direct Known Subclasses:
EditorSelectorReference

public class SelectorReference extends FixedVirtualizedAbstractReference<Selector>
The SelectorReference property class hold the reference to a Selector that defines if the owner of this reference should be selected or active, or if it should be inactive.
Author:
Christopher Mindus
  • Constructor Details

    • SelectorReference

      public SelectorReference()
      Creates a Selector Reference property with no name and with a null value.
    • SelectorReference

      public SelectorReference(Atom propertyAtom)
      Creates a Selector Reference property with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • SelectorReference

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

    • isPropPrivateAtCreation

      protected boolean isPropPrivateAtCreation()
      Called upon creation of the property to check it's private state. This is used by properties that are not distributed to the remote party.
      Overrides:
      isPropPrivateAtCreation in class GProp<ReferenceString>
      Returns:
      true, always.
    • getReferenceType

      public IPropReference.IRefType getReferenceType()
      Gets the reference Type.
      Specified by:
      getReferenceType in interface IPropReference
      Specified by:
      getReferenceType in interface IReferencingGProp
      Specified by:
      getReferenceType in class AbstractReference<Selector>
      Returns:
      IPropReference.RefType.Selector.
    • getPropertyClass

      public Class<?> getPropertyClass()
      Gets the class wanted.
      Specified by:
      getPropertyClass in class AbstractReference<Selector>
      Returns:
      Selector.class.
    • isReferenceValid

      public boolean isReferenceValid(GProp<?> property)
      Validates the property reference that has been looked up.
      Specified by:
      isReferenceValid in interface IPropReference
      Specified by:
      isReferenceValid in class AbstractReference<Selector>
      Parameters:
      property - The property to validate.
      Returns:
      true if valid, false otherwise.
    • getSelector

      public Selector getSelector()
      Gets the Selector for this reference.

      The method first attempts to use the resolved mechanism of getting the selector. If this has failed or has not been resolved yet, the property tree will be used to search for it. The latter is, of course, slower.

      Returns:
      The Selector instance, or null if not found.
    • isSelectorSelected

      public boolean isSelectorSelected(EnvProps envProps)
      Verifies if this selector reference causes the owner to be selected or not.
      Parameters:
      envProps - The Client Properties for the Client connections.
      Returns:
      true if selected, false if unselected or the reference is not resolved.