Class VSRelativeReference<TARGET extends VSComponent>

    • Field Detail

      • reference

        protected PropReference reference
        The instance of the property reference.
      • vsRefBase

        protected java.lang.String vsRefBase
        The current VSReference base.
      • currentTarget

        protected TARGET extends VSComponent currentTarget
        The current target reference.
      • fixedTarget

        protected TARGET extends VSComponent fixedTarget
        The current target reference. This reference may be virtualized or not depending on if this reference is located in the VirtualSpace being virtualized (not probable), or if it's located in e.g. a panel that is virtualized caused by a VirtualSpace. This instance is then kept as long as the reference string is not changed. If it is changed, this relative-reference-property reverts back to non-fixed mode.
    • Constructor Detail

      • VSRelativeReference

        public VSRelativeReference()
        Creates a VirtualSpace Reference property with no name and with a null value.
      • VSRelativeReference

        public VSRelativeReference​(Atom propertyAtom)
        Creates a VirtualSpace Reference property with the specified name with a null value.
        propertyAtom - the property atom.
      • VSRelativeReference

        public VSRelativeReference​(Atom propertyAtom,
                                   java.lang.String newValue)
        Creates a VirtualSpace Reference property with the specified name and value.
        propertyAtom - the property atom.
        newValue - the new string value for the property.
    • Method Detail

      • 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.
        isPropPrivateAtCreation in class GProp<java.lang.String>
        true, always.
      • disposeReference

        protected void disposeReference()
        Disposes and clears the reference.
      • onPropDispose

        protected void onPropDispose()
        Property disposed of: dispose of reference.
        onPropDispose in class GProp<java.lang.String>
      • onVirtualized

        protected void onVirtualized​(IAppSessionGyro appGyro,
                                     IClientSessionGyro clientGyro,
                                     VirtualSpace virtualSpace,
                                     PropCnr virtualizedProp,
                                     GProp<?> clonedProp)
        Called when this property has been virtualized.

        Override to perform required processing.

        onVirtualized in class GProp<java.lang.String>
        appGyro - The application gyro instance performing the virtualization.
        clientGyro - The client gyro session, can be null if not initialized from the client gyro.
        virtualSpace - The virtualized VirtualSpace.
        virtualizedProp - The property being virtualized.
        clonedProp - The property that is cloned to produce this virtualized property.
      • equalsErrors

        protected boolean equalsErrors​(PropError pe1,
                                       PropError pe2,
                                       int how)
        Processes error property verification. The default processing is to verify the two error properties pe1 and pe2 for equality if includeErrors is 0 or 1, and returns true if the value is 2=no comparison with error properties.

        Override to verify property errors for reference properties.

        equalsErrors in class GProp<java.lang.String>
        pe1 - The first error property, may be null.
        pe2 - The second error property, may be null.
        how - Flags EQC_* values for equal checking.
        Equality flag depending on includeErrors value.
      • onEventSelf

        public final void onEventSelf​(GEvent event)
        Called when a property event is send to this property.

        A subclass can override this method to perform appropriate processing and is not required to call super.onEventSelf(e).

        Specified by:
        onEventSelf in interface IGProp<TARGET extends VSComponent>
        onEventSelf in class GProp<java.lang.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<java.lang.String>
        event - The resolve references event.
      • onPropParentChanged

        protected final void onPropParentChanged​(PropCnr oldParent,
                                                 PropCnr newParent)
        The parent has been changed, if added to a container or moved, recheck the reference.
        onPropParentChanged in class GProp<java.lang.String>
        oldParent - The old parent (or null if none).
        newParent - The new parent (or null if none).
      • resolve

        public void resolve​(boolean doReCheck,
                            GEvent event)
        Resolves the reference.
        doReCheck - Performs a re-check in case e.g. reference class type changes.
        event - The triggering event, null for none.
      • getReference

        public java.lang.String getReference()
        Gets the full reference string.
        The full reference string, or another reference string for failure in case it cannot be retrieved, or null for no reference defined.
      • onVSReferenceChanged

        protected void onVSReferenceChanged​(GEvent event)
        Rechecks the reference, the VSReference has changed.
      • setInvalid

        protected void setInvalid()
        Sets as invalid.
      • createReference

        protected void createReference​(GEvent event)
        Creates the reference.
      • resolve

        protected final void resolve​(PropReference ref,
                                     boolean doReCheck,
                                     GEvent event)
        Resolves the reference.
      • onReferenceEvent

        public void onReferenceEvent​(PropReference reference,
                                     IPropReference.ReferenceChangeEvent event,
                                     GEvent triggerEvent)
        Called when a property reference event occurs. The events are ReferenceChangeEvent.FOUND, FOUND_WRONG_CLASS, RENAMED, MOVED, NEW_PROPERTY, BROKEN.
        Specified by:
        onReferenceEvent in interface IPropReference
        reference - The property reference object.
        event - The event.
        triggerEvent - The event that triggered this reference event, null for none.
      • clearError

        protected final void clearError()
        Clears the error.
      • addError

        protected final void addError​(java.lang.String err)
        Adds an error.
      • targetChanged

        protected final void targetChanged​(GProp<?> prop)
        Internal method called when target changes.
      • getVSTarget

        public final TARGET getVSTarget()
        Gets the target VS component.
        The target resolved, null for none (or not a valid reference).
      • isReferenceValid

        public boolean isReferenceValid​(GProp<?> property)
        Validates the property reference that has been looked up. Override to provide additional functionality than checking for property class type matching with getPropertyClass().
        Specified by:
        isReferenceValid in interface IPropReference
        property - The property to validate.
        true if valid, false otherwise.
      • getReferences

        public int getReferences​(java.util.List<Reference> references)
        Gets the references of this property top others. This method is typically used in the Designer to search for circular references during verification.
        Specified by:
        getReferences in interface IGProp<TARGET extends VSComponent>
        getReferences in class GProp<java.lang.String>
        references - The references array is filled in by this method.
        The count of references added.
      • onVirtualizationCompleted

        protected void onVirtualizationCompleted​(IAppSessionGyro appGyro,
                                                 IClientSessionGyro clientGyro,
                                                 VirtualSpace virtualSpace,
                                                 PropCnr virtualizedProp,
                                                 boolean isPostResolve)
        Called when virtualization completed.

        This method is called to the entire tree of the newly virtualized property container.

        onVirtualizationCompleted in class GProp<java.lang.String>
        appGyro - The application gyro instance performing the virtualization.
        clientGyro - The client gyro session, can be null if not initialized from the client gyro.
        virtualSpace - The virtualized VirtualSpace.
        virtualizedProp - The property being virtualized.
        isPostResolve - Flag indicating this call is done after references are attempted to be resolved.
      • getPropertyClass

        public abstract java.lang.Class<? extends GProp<?>> getPropertyClass()
        Gets the class wanted.
      • getReferenceDescription

        public abstract java.lang.String getReferenceDescription()
        Gets a short description of this reference, e.g. "VirtualSpace" or "Label For".
        Specified by:
        getReferenceDescription in interface IPropReference
        The reference description string.
      • onResolved

        protected abstract void onResolved​(TARGET target)
        Called when the property reference has been resolved.
        target - The target reference.
      • onRemoved

        protected abstract void onRemoved​(TARGET oldTarget)
        Called when the property reference has been disposed of e.g. due to new reference or pure disposal of this property.
        oldTarget - The old target reference.