Class AbstractUICompRelativeReference<TARGET extends IUICompRelativeTarget>

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

public abstract class AbstractUICompRelativeReference<TARGET extends IUICompRelativeTarget> extends AbstractBaseRelativeReference<TARGET>
The UIComp Relative Reference property class hold the reference to another property in the same base container.
Author:
Christopher Mindus
  • Constructor Details

    • AbstractUICompRelativeReference

      public AbstractUICompRelativeReference()
      Creates an abstract UIComp Relative Reference property with no name and with a null value.
    • AbstractUICompRelativeReference

      public AbstractUICompRelativeReference(Atom propertyAtom)
      Creates an abstract UIComp Relative Reference property with the specified name with a null value.
      Parameters:
      propertyAtom - the property atom.
    • AbstractUICompRelativeReference

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

    • clone

      Clone overridden to ensure reference is created before cloning to have the "cidValue" cloned.
      Overrides:
      clone in class AbstractReference<TARGET extends IUICompRelativeTarget>
    • resetComponentID

      public void resetComponentID()
      Resets the component ID referenced. This method is typically used in the Designer to clear existing references when copying or moving components.
    • appendPropValue

      protected void appendPropValue(PropMgr propertyManager, SendTransaction trans, Object value)
      Overrides the send-transaction to client in order to send the unique label ID in the panel.
      Overrides:
      appendPropValue in class AbstractReference<TARGET extends IUICompRelativeTarget>
      Parameters:
      propertyManager - the property manager instance.
      trans - transaction to append the properties to.
      value - the value to append to the transaction, a reference to the current property value.
    • initializeValue

      public boolean initializeValue(PropMgr propertyManager, ReadTransaction trans)
      Fakes processing of initializing the value from the remote part by skipping it in the transaction. This value is local in the Editor/Server.
      Overrides:
      initializeValue in class AbstractReference<TARGET extends IUICompRelativeTarget>
      Parameters:
      propertyManager - the property manager.
      trans - the transaction to initialize the property with.
      Returns:
      true if the value has changed, false otherwise.
    • onEventSelf

      public void onEventSelf(GEvent event)
      Overridden to check for cache clearing...
      Specified by:
      onEventSelf in interface IGProp<TARGET extends IUICompRelativeTarget>
      Overrides:
      onEventSelf in class AbstractReference<TARGET extends IUICompRelativeTarget>
      Parameters:
      event - The property event.
    • informResolved

      protected void informResolved()
      Called when the property has been resolved. Subclasses override this method to implement some behavior. The default implementation performs nothing, i.e. there is no need to call super.informResolved().
      Overrides:
      informResolved in class AbstractReference<TARGET extends IUICompRelativeTarget>
    • informError

      protected void informError()
      Called when the property has an error. Subclasses override this method to implement some behavior. The default implementation performs nothing, i.e. there is no need to call super.informError().
      Overrides:
      informError in class AbstractReference<TARGET extends IUICompRelativeTarget>
    • isPropReferenceTreeValid

      public final boolean isPropReferenceTreeValid()
      Verifies if the tree is valid for reference creation. This method is typically overridden in a root property that has a Property Manager owner that in turn is checked for a particular configuration (e.g. Client-related references such as LabelForReference that does not create references when communicating).
      Specified by:
      isPropReferenceTreeValid in interface IGProp<TARGET extends IUICompRelativeTarget>
      Overrides:
      isPropReferenceTreeValid in class GProp<ReferenceString>
      Returns:
      true if the root property manager is found, false otherwise.
    • getReferenceString

      protected final String getReferenceString(IPropCnr cnr)
      Gets the reference string for a property container.

      An overriding method might convert the reference from e.g. old full path format for UI to the short UI reference format.

      Overrides:
      getReferenceString in class AbstractBaseRelativeReference<TARGET extends IUICompRelativeTarget>
      Parameters:
      cnr - The container reference, might be null for none.
      Returns:
      The default is to return IGProp.getReferencePropName(), but e.g. for UI, it may be overridden, null if cnr is null.
    • getScopeErrorMessage

      protected final String getScopeErrorMessage(TARGET property, PropCnr base)
      Gets the error message when the base container doesn't validate scope.
      Overrides:
      getScopeErrorMessage in class AbstractBaseRelativeReference<TARGET extends IUICompRelativeTarget>
      Parameters:
      property - The property being targeted.
      base - The base property reference.
      Returns:
      "Target reference is not a child of the base property container".