Class VSRelativeReference<TARGET extends VSComponent>
- All Implemented Interfaces:
EventListener
,IGProp<String>
,IPropReference
,IReferencingGProp
,Cloneable
- Direct Known Subclasses:
VSActionReference
,VSColumnReference
,VSComponentReference
,VSFieldReference
,VSFocusReference
,VSGroupReference
,VSOnUIEvent
,VSTableColumnReference
,VSTableReference
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.prop.IPropReference
IPropReference.IRefType, IPropReference.ReferenceChangeEvent, IPropReference.RefType
Field Summary
Modifier and TypeFieldDescriptionprotected TARGET
The current target reference.protected TARGET
The current target reference.protected PropReference
The instance of the property reference.protected String
The current VSReference base.Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
ConstructorDescriptionCreates a VirtualSpace Reference property with no name and with a null value.VSRelativeReference
(Atom propertyAtom) Creates a VirtualSpace Reference property with the specified name with a null value.VSRelativeReference
(Atom propertyAtom, String newValue) Creates a VirtualSpace Reference property with the specified name and value.Method Summary
Modifier and TypeMethodDescriptionprotected final void
Adds an error.protected final void
Clears the error.clone()
Overrides clone to clear existing reference.protected void
createReference
(GEvent event) Creates the reference.protected void
Disposes and clears the reference.protected boolean
equalsErrors
(PropError pe1, PropError pe2, int how) Processes error property verification.Gets the class wanted.Gets the full reference string.abstract IPropReference.IRefType
Gets the reference Type.final TARGET
Gets the target VS component.protected boolean
Called upon creation of the property to check it's private state.boolean
isReferenceValid
(GProp<?> property) Validates the property reference that has been looked up.final void
onEventSelf
(GEvent event) Called when a property event is send to this property.protected void
Property disposed of: dispose of reference.protected final void
onPropParentChanged
(PropCnr oldParent, PropCnr newParent) The parent has been changed, if added to a container or moved, recheck the reference.protected void
Called to perform reference resolving.void
onReferenceEvent
(PropReference reference, IPropReference.ReferenceChangeEvent event, GEvent triggerEvent) Called when a property reference event occurs.protected abstract void
Called when the property reference has been disposed of e.g.protected abstract void
onResolved
(TARGET target) Called when the property reference has been resolved.protected void
onVirtualizationCompleted
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.protected void
onVSReferenceChanged
(GEvent event) Rechecks the reference, the VSReference has changed.protected String
Returns the parameter string representing the state of this event.void
Resolves the reference.protected final void
resolve
(PropReference ref, boolean doReCheck, GEvent event) Resolves the reference.protected void
Sets as invalid.protected final void
targetChanged
(GProp<?> prop) Internal method called when target changes.protected VSRelativeReference<TARGET>
virtualize
(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) Call this method to "virtualize" a property tree.Methods inherited from class com.iizix.prop.StringProp
appendPropValue, getPropValue0, getString, getString, getValueClasses, initializeValue, setPropValue, toNativeValue0, validatePropType
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsObj, equalsPropValue, equalsTree, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeElement, initializeGElement, initializeGProp, initializeProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPrepare, onPropInvalidateCache, onPropTreeInitialized, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toElementString, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropValue, verify, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.prop.IReferencingGProp
getDirectReferencedTarget, getDirectReferencedTargetSet, getParent, getReferencingOwner, isReferencingMultipleTargets
Field Details
reference
The instance of the property reference.vsRefBase
The current VSReference base.currentTarget
The current target reference.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 Details
VSRelativeReference
public VSRelativeReference()Creates a VirtualSpace Reference property with no name and with a null value.VSRelativeReference
Creates a VirtualSpace Reference property with the specified name with a null value.- Parameters:
propertyAtom
- the property atom.
VSRelativeReference
Creates a VirtualSpace 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 classGProp<String>
- Returns:
- true, always.
disposeReference
protected void disposeReference()Disposes and clears the reference.onPropDispose
protected void onPropDispose()Property disposed of: dispose of reference.- Overrides:
onPropDispose
in classGProp<String>
clone
Overrides clone to clear existing reference.- Overrides:
clone
in classStringProp
- Returns:
- A new cloned String property.
virtualize
protected VSRelativeReference<TARGET> virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace) throws CloneNotSupportedException, PropException Call this method to "virtualize" a property tree. This method is used at runtime in the Server for the application session of virtual instances of VirtualSpace, but also virtual instances of panels, for the individual client session. The VirtualSpace is virtualized once for the application session and is shared for parallel client sessions.This method is similar to cloning, but enables references that are already resolved to remain if they point to a shared instance, e.g. the VirtualSpace pointing to its participants in the application property container shared instance, or a panel with references to text IDs, assets, etc.
It is up to the property class to handle this by overriding this method.
- Overrides:
virtualize
in classGProp<String>
- Parameters:
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized VirtualSpace.- Returns:
- The virtualized property.
- Throws:
CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.IllegalStateException
- IllegalStateException if the property is in an invalid state, e.g. in virtualizing state or if in
equalsErrors
Processes error property verification. The default processing is to verify the two error propertiespe1
andpe2
for equality ifincludeErrors
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.
- Overrides:
equalsErrors
in classGProp<String>
- Parameters:
pe1
- The first error property, may be null.pe2
- The second error property, may be null.how
- Flags EQC_* values for equal checking.- Returns:
- Equality flag depending on
includeErrors
value.
onEventSelf
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 interfaceIGProp<TARGET extends VSComponent>
- Overrides:
onEventSelf
in classGProp<String>
- Parameters:
event
- The property event.
onReferenceEvent
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 callsuper.onReferenceEvent(ResolveReferenceEvent event)
.- Overrides:
onReferenceEvent
in classGProp<String>
- Parameters:
event
- The resolve references event.
onPropParentChanged
The parent has been changed, if added to a container or moved, recheck the reference.- Overrides:
onPropParentChanged
in classGProp<String>
- Parameters:
oldParent
- The old parent (or null if none).newParent
- The new parent (or null if none).
resolve
Resolves the reference.- Parameters:
doReCheck
- Performs a re-check in case e.g. reference class type changes.event
- The triggering event, null for none.
getReference
Gets the full reference string.- Returns:
- The full reference string, or another reference string for failure in case it cannot be retrieved, or null for no reference defined.
onVSReferenceChanged
Rechecks the reference, the VSReference has changed.setInvalid
protected void setInvalid()Sets as invalid.createReference
Creates the reference.resolve
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 interfaceIPropReference
- Parameters:
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
Adds an error.targetChanged
Internal method called when target changes.getVSTarget
Gets the target VS component.- Returns:
- The target resolved, null for none (or not a valid reference).
isReferenceValid
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 interfaceIPropReference
- Parameters:
property
- The property to validate.- Returns:
- true if valid, false otherwise.
onVirtualizationCompleted
protected void onVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, boolean isPostResolve) Called when virtualization completed.This method is called to the entire tree of the newly virtualized property container.
- Overrides:
onVirtualizationCompleted
in classGProp<String>
- Parameters:
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can benull
if not initialized from the client gyro.virtualSpace
- The virtualized VirtualSpace.isPostResolve
- Flag indicating this call is done after references are attempted to be resolved.
paramString
Returns the parameter string representing the state of this event. This string is useful for debugging. Subclasses adds extra information to the string by preceding it with a comma followed by the extra information.- Overrides:
paramString
in classGProp<String>
- Returns:
- the parameter string of this event.
getPropertyClass
Gets the class wanted.getReferenceType
Gets the reference Type.- Specified by:
getReferenceType
in interfaceIPropReference
- Specified by:
getReferenceType
in interfaceIReferencingGProp
- Returns:
- The reference type, generally a value from the enum
IPropReference.RefType
, otherwise a static final implementation of the reference type with locale support.
onResolved
Called when the property reference has been resolved.- Parameters:
target
- The target reference.
onRemoved
Called when the property reference has been disposed of e.g. due to new reference or pure disposal of this property.- Parameters:
oldTarget
- The old target reference.