Class VSParticipantsHolder
- All Implemented Interfaces:
EventListener, IGProp<GProp<?>[]>, IPropCnr, Cloneable
- Direct Known Subclasses:
EditorVSParticipantsHolder
- Author:
- Christopher Mindus
Field Summary
Fields inherited from class PropCnr
EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_IDFields inherited from class 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_ATTR_STRING_SECRET, PROP_USER_1, PROP_USER_2Fields inherited from interface IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EQC_SAVE_RELEVANT_ONLY, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATEConstructor Summary
ConstructorsConstructorDescriptionCreates a VSParticipantsHolder container without name.VSParticipantsHolder(Atom name) Creates a VSParticipantsHolder container with a name.Method Summary
Modifier and TypeMethodDescriptionvoidadd(IVSParticipant participant, IComplexOperation op) Adds a new participant.static intaddParticipants(GProp<?>[] props, IComplexOperation op) Adds the participants that a paste brings in to the lists of their VirtualSpaces, in the same operation as the paste: the mirror ofremoveParticipants(GProp[], IComplexOperation).clone()Clones the instance.booleancontains(IVSParticipant participant) Checks if the participant is present in this container.booleanChecks if the participant is present in this container.<PC extends PropCnr>
PC[]getParticipants(Class<PC> propClass) Gets all the participants of a certain type, e.g.Gets the VirtualSpace associated with this participant holder.protected booleanThis property container is private and not transported to remote party.voidonEventSelf(GEvent event) Checks for state change events and fires it to listeners.protected voidInvalidates a potential cache in this property.voidonVirtualSpaceVirtualized(VirtualSpace virtualizedVirtualSpace, IAppSessionGyro appGyro) Called when the VirtualSpace has been virtualized, giving the opportunity for e.g.booleanremove(IVSParticipant participant, IComplexOperation op) Removes an existing participant.booleanremove(String ref, IComplexOperation op) Removes an existing participant.static intremoveParticipants(GProp<?>[] props, IComplexOperation op) Removes the participants that a deletion takes away from the lists of their VirtualSpaces, in the same operation as the deletion.static booleansetVirtualSpace(IVSParticipant participant, VirtualSpace virtualSpace, IComplexOperation op) Sets, changes or removes the VirtualSpace reference of a participant, and keeps the participant lists in step with it in the same operation: the participant leaves the list of the VirtualSpace it referred to and joins the list of the new one.booleanverify(PropVerification verification) Verifies this property container.Methods inherited from class ReferralsHolder
usesPropIndexMethods inherited from class PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializePropTree, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isPropValueTreeLockNeeded, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropDispose, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualizeMethods inherited from class GProp
addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, 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, 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, hasChanged, hasCircularReferencesError, hashCode, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropErrorPersisted, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropForEditorAtCreation, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropSaveRelevant, isPropSecret, isPropSecretCapable, isPropUSER, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onInitialize, onPrepare, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropSecret, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toShortString, toShortString, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IGProp
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warningMethods inherited from interface IPropCnr
canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
Constructor Details
VSParticipantsHolder
public VSParticipantsHolder()Creates a VSParticipantsHolder container without name.VSParticipantsHolder
Creates a VSParticipantsHolder container with a name.- Parameters:
name- The name of the container.
Method Details
isPropPrivateAtCreation
protected boolean isPropPrivateAtCreation()This property container is private and not transported to remote party.- Overrides:
isPropPrivateAtCreationin classGProp<GProp<?>[]>- Returns:
- true if the property should be set to private at creation, false for default.
clone
Clones the instance.getVirtualSpace
Gets the VirtualSpace associated with this participant holder.- Returns:
- The VirtualSpace, or null if not added yet.
add
Adds a new participant.- Parameters:
participant- The participant.op- The undo/redo operation, null to add it directly.
remove
Removes an existing participant.- Parameters:
participant- The participant.op- The undo/redo operation, null to remove it directly.- Returns:
- true for success, false for nothing performed participant not found.
remove
Removes an existing participant.- Parameters:
ref- The participant reference.op- The undo/redo operation, null to remove it directly.- Returns:
- true for success, false for nothing performed participant not found.
contains
Checks if the participant is present in this container.- Parameters:
participant- The participant.- Returns:
- true if participant is found.
contains
Checks if the participant is present in this container.getParticipants
onPropInvalidateCache
protected void onPropInvalidateCache()Invalidates a potential cache in this property. This method is called during a synchronized state of the property. Subclasses override this method to provide a robust caching mechanism.- Overrides:
onPropInvalidateCachein classGProp<GProp<?>[]>
onEventSelf
Checks for state change events and fires it to listeners.- Specified by:
onEventSelfin interfaceIGProp<GProp<?>[]>- Overrides:
onEventSelfin classGProp<GProp<?>[]>- Parameters:
event- The property event.
setVirtualSpace
public static boolean setVirtualSpace(IVSParticipant participant, VirtualSpace virtualSpace, IComplexOperation op) Sets, changes or removes the VirtualSpace reference of a participant, and keeps the participant lists in step with it in the same operation: the participant leaves the list of the VirtualSpace it referred to and joins the list of the new one. With the reference already set, a missing entry in the new VirtualSpace is added, which repairs the list.The old VirtualSpace is read before the reference changes, because a reference resolves again as soon as its value is set. A reference that does not resolve names no VirtualSpace, so there is no list to remove the participant from.
This is the one implementation for the Designer, where
oprecords every change for Undo/Redo so that one Undo restores the reference and the entry together, and for the direct path with a nullop.- Parameters:
participant- The participant.virtualSpace- The new VirtualSpace, null to remove the reference.op- The undo/redo operation, null to perform the changes directly.- Returns:
- true if anything changed, false if the reference and the lists were already in step.
removeParticipants
Removes the participants that a deletion takes away from the lists of their VirtualSpaces, in the same operation as the deletion. Call it BEFORE the properties are removed, while their VirtualSpace references still resolve.A deleted property takes a participant away when it is a participant's VirtualSpace reference, when it is a participant, or when participants are in its tree (a folder, a file).
The reverse direction is kept in step the same way: a deleted list entry takes away the VirtualSpace reference of the participant it names, when that participant refers to the entry's VirtualSpace and no other entry of the list names it (a duplicate, which the verification reports). An entry that does not resolve, or whose participant refers elsewhere, is stale and goes alone.
- Parameters:
props- The properties about to be deleted.op- The undo/redo operation of the deletion, null to remove the entries directly.- Returns:
- The count of entries and references removed.
addParticipants
Adds the participants that a paste brings in to the lists of their VirtualSpaces, in the same operation as the paste: the mirror ofremoveParticipants(GProp[], IComplexOperation). Call it AFTER the properties are in the tree, when their names are final and their VirtualSpace references resolve.A pasted property brings in a participant when it is a participant's VirtualSpace reference, when it is a participant, or when participants are in its tree (a folder, a file). Each one joins the list of the VirtualSpace its reference resolves to, under its own name: the copy of a listed panel is listed beside its original, and a panel pasted after a Cut, which removed its entry, is listed again.
No entry is added for a reference that does not resolve (there is no list to join), for a participant that is listed already, or to a list that cannot be written (the VirtualSpace, or a container above it, is read-only). The verification of the participant's reference then reports the missing entry, with its Quick Fix, as before.
- Parameters:
props- The properties the paste added.op- The undo/redo operation of the paste, null to add the entries directly.- Returns:
- The count of entries added.
verify
Verifies this property container. The check performed is the extension of classes and that no circular reference is present.onVirtualSpaceVirtualized
public void onVirtualSpaceVirtualized(VirtualSpace virtualizedVirtualSpace, IAppSessionGyro appGyro) Called when the VirtualSpace has been virtualized, giving the opportunity for e.g. data connectors to prepare it's virtualized counterparts if this is required.This call is done to the non-virtualized instance of the VirtualSpace participant.
Client code should not call this method as it is intended to be called from the framework.
- Parameters:
virtualizedVirtualSpace- The virtualized VirtualSpace instance.appGyro- The application gyro instance.