public class PropCnr extends GProp<GProp<?>[]> implements IPropCnr
Modifier and Type | Field and Description |
---|---|
static GProp<?>[] |
EMPTY
Empty array of properties.
|
static Class<?>[] |
EMPTY_CLASSES
Empty array of classes.
|
static PropCnr[] |
EMPTY_CNRS
Empty array of property containers.
|
static String |
EXTENDS_FRAMEWORK_ERROR_ID
The String ID for errors in the Extends Framework for PropErrorInput.
|
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
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 and Description |
---|
PropCnr()
Creates a property container without name.
|
PropCnr(Atom propertyAtom)
Creates a property container with the specified name.
|
PropCnr(Atom propertyAtom,
GProp<?>[] properties)
Creates a property container with the specified name and properties.
|
Modifier and Type | Method and Description |
---|---|
void |
__transferChildProps(PropCnr pc)
Transfers all properties from another container to this container.
|
protected void |
addPredefinedProps()
Adds the predefined properties for this container.
|
boolean |
addProp(IGProp<?> property)
Adds a new property to this container at the end.
|
boolean |
addProp(IGProp<?> property,
IGProp<?> trigger)
Adds a new property to this container at the end.
|
boolean |
addProp2(IGProp<?> property)
Adds a new property to this container at the end.
|
boolean |
addProp2(IGProp<?> property,
IGProp<?> trigger)
Adds a new property to this container at the end.
|
protected void |
appendPropValue(PropMgr propertyManager,
Transaction trans,
Object value)
Appends the container property value.
|
String |
canRequestFocus()
Returns if this component can receive focus.
|
PropCnr |
clone()
Creates a clone out of this property.
|
void |
completeVirtualize(IAppSessionGyro appGyro,
IClientSessionGyro clientGyro,
VirtualSpace virtualSpace,
PropCnr virtualizedProp)
Once the property container has been virtualized and added into a virtualized container,
a call to this routine should be done.
|
boolean |
containsProp(Atom atom)
Checks for presence of the property in the container.
|
boolean |
containsProp(String name)
Checks for presence of the property in the container.
|
protected GProp<?> |
convertLoadedProp(GProp<?> childProp)
Enables conversion or omission of a property loaded from XML.
|
String |
couldRequestFocusIfVirtualized(boolean ignoreStates)
Returns if this component could receive focus if it would be virtualized.
|
Atom |
createCopyOfAtom(Atom name)
Creates a "Copy of NNN" or "Copy 2 of NNN" of an atom.
|
Atom |
createUniqueAtom(Atom name,
String first,
String next,
String next2)
Creates an atom with the base name specified with a unique serial number (starting with
one) appended, making this atom unique within this property container.
|
Atom |
createUniqueAtom(String baseName)
Creates an atom with the base name specified with a unique serial number (starting with
one) appended, making this atom unique within this property container.
|
Atom |
createUniqueAtom(String baseName,
String adder)
Creates an atom with the base name specified with a unique serial number (starting with
one) appended, making this atom unique within this property container.
|
VSReference |
createVSReference(Atom refAtom,
PropCnr[] returnParent)
Creates a VSReference instance from the container or any parent containers.
|
protected boolean |
doPropEqualsArrayValues()
Method checking if the property container should do a normal comparison with its contents based on
extends framework, atoms, errors, etc.
|
protected void |
doVirtualizePropCnr(IAppSessionGyro appGyro,
IClientSessionGyro clientGyro,
GProp<?>[] props,
String extendsName,
VirtualSpace virtualSpace,
PropCnr virtualizedProp,
PropCnr clonedProp)
The rest of the virtualization is done using the correct "this" for inner classes.
|
boolean |
enablePropCommunication(boolean on)
Enables communication of this container.
|
boolean |
enablePropHashMap()
Enables usage of string hash map to property for fast access.
|
protected Object |
equalsTree(PropCnr pc2,
Class<? extends GProp<?>> arrayItemClass,
int how)
Checks for equality in the whole container structure.
|
protected Object |
equalsTree(PropCnr pc2,
int how)
Checks for equality in the whole container structure.
|
GProp<?>[] |
getAllProps(Class<?>[] classes,
boolean includeErrors)
Gets the properties of certain classes that are present in the tree below this container,
i.e.
|
int |
getAllProps(Class<?>[] classes,
List<GProp<?>> list)
Gets the properties of a certain class that are present in the tree below this container,
i.e.
|
int |
getAllProps(Class<?>[] classes,
List<GProp<?>> list,
boolean includeErrors)
Gets the properties of certain classes that are present in the tree below this container,
i.e.
|
GProp<?>[] |
getAllProps(Class<? extends GProp<?>>... classes)
Gets the properties of certain classes that are present in the tree below this container,
i.e.
|
<GP> GP[] |
getAllProps(Class<GP> clazz)
Gets the properties of a certain class that are present in the tree below this container,
i.e.
|
<GP> GP[] |
getAllProps(Class<GP> clazz,
boolean includeErrors)
Gets the properties of a certain class that are present in the tree below this container,
i.e.
|
<GP> int |
getAllProps(Class<GP> clazz,
List<GP> list)
Gets the properties of a certain class that are present in the tree below this container,
i.e.
|
<GP> int |
getAllProps(Class<GP> clazz,
List<GP> list,
boolean includeErrors)
Gets the properties of a certain class that are present in the tree below this container,
i.e.
|
boolean |
getBool(Atom atom)
Gets a boolean property from this property container.
|
boolean |
getBool(Atom atom,
boolean defaultValue)
Gets a boolean property from this property container.
|
boolean |
getBool(String name)
Gets a boolean property from this property container.
|
boolean |
getBool(String name,
boolean defaultValue)
Gets a boolean property from this property container.
|
IPropErrorItem |
getChildPropError(Atom atom)
Gets the child property default error ID.
|
IPropErrorItem |
getChildPropError(String name)
Gets the child property default error ID.
|
int |
getChildPropErrorSeverity(Atom atom)
Gets the error severity of a child property.
|
int |
getChildPropErrorSeverity(String name)
Gets the error severity of a child property.
|
ErrorsProp |
getErrorsProp(boolean createIfNotPresent)
Gets the errors property.
|
PropCnr |
getExtendsContainer()
Gets the extends container.
|
String |
getExtendsError()
Gets the Extends Framework error.
|
String |
getExtendsName()
Gets the reference property name being extended.
|
Atom[] |
getExtendsOverride()
Gets the extends override atoms.
|
Class<?>[] |
getExtendsPossibleClasses()
Gets the possible classes this container supports for the Extends Framework.
|
GProp<?> |
getFirstProp(Atom atom)
Finds the first property with the specified atom in the property tree.
|
GProp<?> |
getFirstProp(String name)
Finds the first property with the specified name in the property tree.
|
IFocusEngine |
getFocusEngine(IFocusComp comp)
Locates the focus engine instance for the specified component.
|
int |
getInt(Atom atom)
Gets an integer property from this property container.
|
int |
getInt(Atom atom,
int defaultValue)
Gets an integer property from this property container.
|
int |
getInt(String name)
Gets an integer property from this property container.
|
int |
getInt(String name,
int defaultValue)
Gets an integer property from this property container.
|
long |
getLong(Atom atom)
Gets a long property from this property container.
|
long |
getLong(Atom atom,
long defaultValue)
Gets a long property from this property container.
|
long |
getLong(String name)
Gets a long property from this property container.
|
long |
getLong(String name,
long defaultValue)
Gets a long property from this property container.
|
double |
getNumber(Atom atom)
Gets a Number property from this property container.
|
double |
getNumber(Atom atom,
double defaultValue)
Gets a Number property from this property container.
|
double |
getNumber(String name)
Gets a Number property from this property container.
|
double |
getNumber(String name,
double defaultValue)
Gets a Number property from this property container.
|
Class<?>[] |
getPossibleChildren()
Gets the acceptable children property classes that can be used in conjunction with e.g.
|
protected void |
getPredefinedProps()
Gets potential references to predefined properties for this container.
|
GProp<?> |
getProp(Atom atom)
Gets the property with the
atom name. |
GProp<?> |
getProp(Atom[] atomPath)
Gets the property from a path of atoms.
|
GProp<?> |
getProp(Atom[] atomPath,
int count)
Gets the property from a path of atoms.
|
<GP extends IGProp<?>> |
getProp(Atom atom,
Class<GP> clazz)
Gets the property with the
atom name and checking the class instance of
the property. |
<GP extends IGProp<?>> |
getProp(Atom atom,
Class<GP> clazz,
boolean logError)
Gets the property with the
atom name and checking the class instance of
the property. |
GProp<?> |
getProp(int index)
Gets the property at requested
index . |
GProp<?> |
getProp(String name)
Gets the property with the specified name.
|
<GP extends IGProp<?>> |
getProp(String name,
Class<GP> clazz)
Gets the property with the specified name and checking the class instance of
the property.
|
<GP extends IGProp<?>> |
getProp(String name,
Class<GP> clazz,
boolean logError)
Gets the property with the specified name and checking the class instance of
the property.
|
PropCnr |
getPropBaseReference()
Gets a base property container reference instance from the container or any parent containers.
|
PropCnr |
getPropCnr()
Gets the property container instance.
|
int |
getPropCount()
Gets the count of properties in the container.
|
int |
getPropIndex(Atom atom)
Gets the index of an atom in this container.
|
int |
getPropIndex(IGProp<?> property)
Gets the index of this property in this container.
|
Atom[] |
getPropIndexes()
Gets the indexes of all properties along with the atom names.
|
GProp<?>[] |
getProps()
Gets the current value set as a a property array,
null
for an uninitialized value. |
<GP> GP[] |
getProps(Class<GP> clazz)
Gets the properties of a certain class, i.e.
|
Object |
getPropValue(Atom atom)
Gets the value of the property by the
atom name. |
<VALUE> VALUE |
getPropValue(Atom atom,
Class<VALUE> clazz)
Gets the value of the property by the
atom name. |
<VALUE> VALUE |
getPropValue(Atom atom,
Class<VALUE> clazz,
boolean logError)
Gets the value of the property by the
atom name. |
Object |
getPropValue(int index)
Gets the value of the property by the
index . |
Object |
getPropValue(String name)
Gets the value of the property by the
name . |
<VALUE> VALUE |
getPropValue(String name,
Class<VALUE> clazz)
Gets the value of the property by the
name . |
<VALUE> VALUE |
getPropValue(String name,
Class<VALUE> clazz,
boolean logError)
Gets the value of the property by the
name . |
protected Object |
getPropValue0(Object value,
int index)
Gets the property value in another class form than the "native" one.
|
int |
getReferences(List<Reference> references)
Gets the references of this property top others.
|
protected PropCnr |
getRetargetedVerifyContainer()
Gets the retargeted verification property container.
|
String |
getString(Atom atom)
Gets a string property from this property container.
|
String |
getString(Atom atom,
String defaultValue)
Gets a string property from this property container.
|
String |
getString(String name)
Gets a string property from this property container.
|
String |
getString(String name,
String defaultValue)
Gets a string property from this property container.
|
Class<?>[] |
getValueClasses()
Gets the list of possible native Java classes that can be used to set a value using
setPropertyValue , in order of importance. |
VSReference |
getVSReference(Atom refAtom)
Gets a VSReference instance from the container or any parent containers.
|
boolean |
hasFocus()
Returns if the component currently has focus.
|
boolean |
hasSendData()
Checks if any data is present in the property container that needs sending to the remote party.
|
protected void |
initializeElement(Element element)
Called when the XML file for the property tree is serialized from properties.
|
boolean |
initializeExtendsFramework(GEvent triggerEvent)
Initializes the extends framework for this container.
|
void |
initializeProp(Element element)
Called to initialize the property from an
Element . |
protected boolean |
initializeValue(PropMgr propertyManager,
Transaction trans)
Initializes the property value from a transaction.
|
protected void |
initPropCnr()
Method called at the earliest possible stage in the constructor of a container property or
it's extending classes, before possible initialization of other properties, etc.
|
boolean |
insertProp(IGProp<?> property,
int index)
Inserts a new property to this container at the specified index.
|
boolean |
isChild(IGProp<?> prop)
Checks if the property parameter is a child property in this container property.
|
boolean |
isExtendsOverriden(Atom atom)
Checks if a property name is overridden in this container when using the Extends Framework.
|
boolean |
isExtendsPropertyValid(GProp<?> property)
Validates an extends property for the Extends Framework.
|
boolean |
isExtendsRoot()
Checks if this container is an Extends Root container, i.e.
|
boolean |
isPropAddRemoveAllowed(PropMgr propertyManager)
For property containers that are index-based, the creator of the container is the only
one who is allowed to add/remove properties.
|
boolean |
isPropCommunicating()
Checks if this property container is used with the communication framework.
|
boolean |
isPropExtended(IGProp<?> property)
Checks if a property is extended from another or if it is a child to this container.
|
boolean |
isSibling(IGProp<?> prop)
Checks if the property parameter is a sibling property in this container property.
|
void |
list(PrintStream out,
int indent)
Prints a listing of this container to the specified output
stream.
|
void |
list(PrintWriter out,
int indent)
Prints out a list, starting at the specified indentation, to the specified
print writer.
|
protected void |
logPropNotFound(String msg)
Logs a warning message specific to a property updated from remote party that is not found during
Remove, Modify or Rename.
|
protected <GP extends IGProp<?>> |
maybeAddProp(GP newlyCreated)
Adds the newly created predefined property instance or returns the existing one.
|
protected void |
onInsertProp(GProp<?> aProperty,
int index,
boolean replace,
boolean isCloning,
PropMgr propMgr,
boolean isMoving)
Method called when the internal function
insertProp is called to verify that this is allowed. |
protected void |
onPropDispose()
Called when a property is disposed of by delete/remove in a container,
or by the dispose method.
|
protected void |
onPropRemoved(GProp<?> prop,
PropMgr propMgr,
boolean isMoving)
Called when a property is removed in this container, before the event is fired, but after the
property has been removed.
|
void |
onPropTreeInitialized()
Called when the property has initialized from the Element when streamed from an XML file,
has had all (if any) children elements and nodes added as properties and that the property
has been added into it's parent.
|
protected void |
onReferenceEvent(ResolveReferencesEvent event)
Called to perform reference resolving.
|
protected String |
paramString()
Returns the parameter string representing the state of this event.
|
List<Throwable> |
prepare(IAppOwner appOwner)
Prepares the property tree for application use by initializing and loading classes, etc.
|
boolean |
removeAllProps()
Removes all properties from this container.
|
boolean |
removeProp(Atom atom)
Removes a property from this container with the specified atom.
|
boolean |
removeProp(Atom atom,
IGProp<?> trigger)
Removes a property from this container with the specified atom.
|
boolean |
removeProp(IGProp<?> property)
Removes a property from this container.
|
boolean |
removeProp(IGProp<?> property,
IGProp<?> trigger)
Removes a property from this container.
|
boolean |
removeProp(int index)
Removes a property from this container with the specified index.
|
boolean |
removeProp(String name)
Removes a property from this container with the specified name.
|
boolean |
removeProp(String name,
IGProp<?> trigger)
Removes a property from this container with the specified name.
|
boolean |
removeProp2(Atom atom)
Convenience method to remove a property from this container with the specified atom.
|
boolean |
removeProp2(Atom atom,
IGProp<?> trigger)
Convenience method to remove a property from this container with the specified atom.
|
boolean |
removeProp2(IGProp<?> property)
Convenience method to remove a property from this container.
|
boolean |
removeProp2(IGProp<?> property,
IGProp<?> trigger)
Convenience method to remove a property from this container.
|
boolean |
removeProp2(String name)
Convenience method to remove a property from this container with the specified name.
|
boolean |
removeProp2(String name,
IGProp<?> trigger)
Convenience method to remove a property from this container with the specified name.
|
boolean |
reorderProps(Atom[] atoms)
Reorders the properties according to the array.
|
void |
replaceProps(PropCnr cnr)
Replaces all properties in this container with the ones from the specified one.
|
String |
requestFocus(IGProp<?> trigger,
boolean isRemoteInduced)
Requests focus to this component.
|
protected String |
requestFocus(IGProp<?> trigger,
boolean isRemoteInduced,
IFocusVetoListener callback)
Requests focus to this component.
|
boolean |
requestFocusEx(IGProp<?> trigger,
boolean isRemoteInduced)
Requests focus to this component.
|
protected boolean |
requestFocusEx(IGProp<?> trigger,
boolean isRemoteInduced,
IFocusVetoListener callback)
Requests focus to this component.
|
void |
resolveReferences(boolean doReCheck)
Resolves references for this container and its children by sending resolve references events.
|
void |
resolveRuntimeReferences(IRuntimeResolver resolver)
Called before transactions are prepared for sending.
|
boolean |
setBool(Atom atom,
boolean value)
Sets a boolean property with the specified atom to the
value
in this property container. |
boolean |
setBool(Atom atom,
boolean value,
boolean logError)
Sets a boolean property with the specified atom to the
value
in this property container. |
boolean |
setBool(Atom atom,
boolean value,
boolean logError,
IGProp<?> trigger)
Sets a boolean property with the specified atom to the
value
in this property container. |
boolean |
setBool(String name,
boolean value)
Sets a boolean property with the specified name to the
value
in this property container. |
protected boolean |
setCreateRequiredProp()
Sets the flag indicating property requires a "create transaction" when sent
to the other party (server to client or vice versa).
|
boolean |
setExtendsName(String newName)
Sets the extends property name.
|
boolean |
setExtendsOverride(Atom atom,
boolean on)
Sets a property name as overridden in this container using extendsFrom another container.
|
boolean |
setInt(Atom atom,
int value)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setInt(Atom atom,
int value,
boolean logError)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setInt(String name,
int value)
Sets an integer property with the specified name to the
value
in this property container. |
boolean |
setLong(Atom atom,
long value)
Sets a long property with the specified atom to the
value
in this property container. |
boolean |
setLong(Atom atom,
long value,
boolean logError)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setLong(Atom atom,
long value,
boolean logError,
IGProp<?> trigger)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setLong(String name,
long value)
Sets a long property with the specified name to the
value
in this property container. |
boolean |
setNumber(Atom atom,
double value)
Sets a Number property with the specified atom to the
value
in this property container. |
boolean |
setNumber(Atom atom,
double value,
boolean logError)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setNumber(Atom atom,
double value,
boolean logError,
IGProp<?> trigger)
Sets an integer property with the specified atom to the
value
in this property container. |
boolean |
setNumber(String name,
double value)
Sets an integer property with the specified name to the
value
in this property container. |
boolean |
setProp(IGProp<?> property)
Sets a property to this container.
|
boolean |
setProp(IGProp<?> property,
IGProp<?> trigger)
Sets a property to this container.
|
boolean |
setProp(IGProp<?> property,
int index)
Adds a new property to this container at the indicated index.
|
boolean |
setProp2(IGProp<?> property)
Convenience method to set a property to this container.
|
boolean |
setProp2(IGProp<?> property,
IGProp<?> trigger)
Convenience method to set a property to this container.
|
boolean |
setPropValue(Atom atom,
Object newValue)
Sets the property with the
atom name to newValue . |
<VALUE> boolean |
setPropValue(Atom atom,
VALUE value,
Class<? extends GProp<VALUE>> propClass)
Sets a property value in the container.
|
boolean |
setPropValue(GProp<?>[] newProps)
Sets a new properties array as the value.
|
boolean |
setPropValue(int index,
Object newValue)
Sets the property at
index to newValue . |
boolean |
setPropValue(String name,
Object newValue)
Sets the property with the
name to newValue . |
<VALUE> boolean |
setPropValue(String name,
VALUE value,
Class<? extends GProp<VALUE>> propClass)
Sets a property value in the container.
|
boolean |
setString(Atom atom,
String value)
Sets a string property with the specified atom to the
value
in this property container. |
boolean |
setString(Atom atom,
String value,
boolean logError)
Sets a string property with the specified atom to the
value
in this property container. |
boolean |
setString(Atom atom,
String value,
boolean logError,
IGProp<?> trigger)
Sets a string property with the specified atom to the
value
in this property container. |
boolean |
setString(String name,
String value)
Sets a string property with the specified name to the
value
in this property container. |
protected boolean |
shouldCreateProps(Element element)
Checks if a child Element should be created as properties or if it should be skipped.
|
String |
toElementString(Object value)
Called from the
initializeProperty(Element element) method
once the element String is retrieved from the first child node of type "#text". |
protected Object |
toNativeValue0(Object value,
int index)
Tries conversion of possibly accepted properties values using the
setPropertyValue method
into the most preferred property value type. |
boolean |
usePropHashMap()
Checks if a hash map is used for looking up properties by name/atom for fast access.
|
boolean |
usesPropIndex()
Checks if index is relevant for this container, e.g.
|
protected void |
validateChildPropInValue(GProp<?> child)
Validates a single child property instance during the call to
validatePropValue(Object newValue) . |
boolean |
validateClassInstances(boolean doPerform,
GProp<?>[] props,
boolean isMove)
Validates the target property container classes for paste/move with additional instance testing, extra check when
the possible children are verified.
|
void |
validatePropType(Object newValue)
Validates the newValue against the property object type.
|
void |
validatePropValue(Object newValue)
Validates the value to set.
|
void |
verify(PropVerification verification)
Verifies this property container.
|
int |
verifyInternalUseOnly(Set<PropCnr> currentlyBeingVerifiedPropCnrs)
Verifies this property after editing.
|
List<String> |
verifyTree()
Verifies if this property container and its children for problems.
|
protected GProp<?> |
virtualize(IAppSessionGyro appGyro,
IClientSessionGyro clientGyro,
VirtualSpace virtualSpace,
PropCnr virtualizedProp)
Call this method to "virtualize" a property tree.
|
addPropError, addPropListener, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, 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, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, onVirtualizationCompleted, onVirtualized, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, verifyHasPropertyItem, warning, warning, warning
getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, verifyHasPropertyItem, warning, warning, warning
public static final GProp<?>[] EMPTY
public static final PropCnr[] EMPTY_CNRS
public static final Class<?>[] EMPTY_CLASSES
public static final String EXTENDS_FRAMEWORK_ERROR_ID
public PropCnr()
public PropCnr(Atom propertyAtom)
propertyAtom
- the property atom.public PropCnr(Atom propertyAtom, GProp<?>[] properties) throws PropException
propertyAtom
- the property atom.properties
- the property array value for the property.PropException
- as structural changes in containers on client is prohibited.protected void onPropDispose()
The Property Container clears the structure of unsent communication requests to clear memory.
This call is done just at the end of the delete/remove routine in the container, without synchronization.
During this call, whatever components that e.g. the client needs to disposed of is done.
Subclasses needing to perform some intelligent operations upon
deletion should do it by overloading this method and always call the
super.onPropDispose()
method.
onPropDispose
in class GProp<GProp<?>[]>
public final PropCnr getPropCnr()
getPropCnr
in interface IPropCnr
public boolean usesPropIndex()
usesPropIndex
in interface IPropCnr
public final boolean enablePropCommunication(boolean on)
Note: this method is recursing down in the tree and is NOT synchronized for for performance reasons.
enablePropCommunication
in interface IPropCnr
on
- flag to turn enable or disable communication mode.public final boolean isPropCommunicating()
isPropCommunicating
in interface IGProp<GProp<?>[]>
isPropCommunicating
in class GProp<GProp<?>[]>
public final boolean isPropAddRemoveAllowed(PropMgr propertyManager)
isPropAddRemoveAllowed
in interface IPropCnr
propertyManager
- The property manager.public final boolean enablePropHashMap()
enablePropHashMap
in interface IPropCnr
public final boolean usePropHashMap()
usePropHashMap
in interface IPropCnr
public boolean isPropExtended(IGProp<?> property)
isPropExtended
in interface IPropCnr
property
- The property to verify.public Class<?>[] getValueClasses()
setPropertyValue
, in order of importance. Note that loss of precision
in data if e.g. an Float property accepts a Double. However, the setPropertyValue
throws IllegalArgumentException
if the range in invalid, e.g. conversion
of a Integer to a Byte, and the value is not -127 to 128.getValueClasses
in interface IGProp<GProp<?>[]>
getValueClasses
in class GProp<GProp<?>[]>
setPropertyValue
method.
The first type is the "native" or most preferred type. The array is at least one item in length
and never null.public PropCnr clone() throws CloneNotSupportedException
Cloning is used for "virtualization" of a property tree in the
server. Client property classes will therefore throw
CloneNotSupportedException
.
Once a tree has been cloned, the change-flag is reset, and the create-flag is set. All listeners are also removed! The new cloned property is an orphan, i.e. has no parent set. All children properties are also (deep) cloned.
Note that the cloning process is done WITHOUT thread synchronization for performance reasons, thus no modifications should be done to the tree!
clone
in class GProp<GProp<?>[]>
CloneNotSupportedException
- If a subclass doesn't allow cloning,
e.g. the client properties.protected void onReferenceEvent(ResolveReferencesEvent event)
Subclasses override this method and only subclasses extending PropCnr
needs to
call super.onReferenceEvent(ResolveReferenceEvent event)
.
onReferenceEvent
in class GProp<GProp<?>[]>
event
- The resolve references event.protected GProp<?> virtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp) throws CloneNotSupportedException, PropException
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.
virtualize
in class GProp<GProp<?>[]>
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.CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.protected void doVirtualizePropCnr(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, GProp<?>[] props, String extendsName, VirtualSpace virtualSpace, PropCnr virtualizedProp, PropCnr clonedProp) throws CloneNotSupportedException, PropException
Do not call this method! The method is intended for classes that are virtualized and needs to set-up the AppSessionGyro, ClientSessionGyro and VirtualSpace very early in the virtualizing process.
appGyro
- The application gyro instance performing the virtualization.clientGyro
- The client gyro session, can be null
if not
initialized from the client gyro.props
- The children properties to virtualize.extendsName
- The name in extends to virtualize.virtualSpace
- The virtualized or virtualizing VirtualSpace.virtualizedProp
- The property being virtualized.clonedProp
- The property that is cloned to produce this virtualized property.CloneNotSupportedException
- If a subclass doesn't allow cloning, e.g. the client properties.PropException
- For property errors during the virtualization.public final void completeVirtualize(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp)
The following is done:
appGyro
- The Application Session Gyro causing the virtualization.clientGyro
- The client gyro session, can be null
if not
initialized from the client gyro.virtualSpace
- The virtualized or virtualizing VirtualSpace.virtualizedProp
- The property being virtualized.IllegalStateException
- If the property container is not virtualized or added into
a virtual container.public final List<Throwable> prepare(IAppOwner appOwner) throws PropException
appOwner
- The application owner.PropException
- For property errors during the application preparation.public void resolveReferences(boolean doReCheck)
doReCheck
- Recheck flag, avoid true
unless really required.protected final boolean setCreateRequiredProp()
The property container overrides this method by first calling
super.setCreateRequiredProp()
then setCreateRequiredProp
to all its children.
setCreateRequiredProp
in class GProp<GProp<?>[]>
protected void initPropCnr()
super.initPropCnr()
method, but lower down the extension change of classes,
this is the first piece of code that should be executed.protected void addPredefinedProps() throws PropException
The method should add properties to create or get reference to using the maybeAddProp
method. When the PropCnr instance is cloned, the method getPredefinedProps()
is called in order for the subclass to be able to retrieve the new instances to these
properties, if stored in instance variables.
Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.
PropException
- for property exceptions.protected void getPredefinedProps()
The method should get reference to using the getProp(...)
methods.
This allows the subclass to be able to retrieve the new instances to the properties created
during addPredefinedProps()
if stored in instance variables.
Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.
protected <GP extends IGProp<?>> GP maybeAddProp(GP newlyCreated) throws PropException
newlyCreated
- The newly created property to add if it is not existing.newlyCreated
instance if the property did not exist, otherwise
the existing instance. The newlyCreated property is disposed of.
The property instance can safely be cast to the requested type (as the one of
newlyCreated
).PropException
- If the property cannot be added or there is a property type error.public void __transferChildProps(PropCnr pc) throws CloneNotSupportedException, IllegalStateException
Note: this method is intended to be used by the framework and not by user code.
pc
- The property container.CloneNotSupportedException
- If a property fails cloning.IllegalStateException
- If called outside of the Designer.public void validatePropType(Object newValue) throws PropTypeException
Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
validatePropType
in interface IGProp<GProp<?>[]>
validatePropType
in class GProp<GProp<?>[]>
newValue
- The new value to set.PropTypeException
- when the new value isn't of the correct class.public void validatePropValue(Object newValue) throws PropException
Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
validatePropValue
in interface IGProp<GProp<?>[]>
validatePropValue
in class GProp<GProp<?>[]>
newValue
- The new value to set.PropException
- when the new value doesn't validate correctly or
as structural changes in containers on client is prohibited.protected void validateChildPropInValue(GProp<?> child) throws PropException
validatePropValue(Object newValue)
.
This method does nothing and subclasses may use it to validate e.g. the instance type.child
- The child property to validate.PropException
- For validation errors.public final boolean setPropValue(GProp<?>[] newProps) throws PropException
PropValueEvent
.
Note: The event PropCnrEvent
is not fired.setPropValue
in interface IPropCnr
newProps
- the new array.PropException
- if read only or structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public boolean setPropValue(Atom atom, Object newValue) throws PropException
atom
name to newValue
.setPropValue
in interface IPropCnr
atom
- the property atom.newValue
- the new value to set for the propertyPropException
- when the new value doesn't validate correctly or
the property with specified name
is
not found.public boolean setPropValue(String name, Object newValue) throws PropException
name
to newValue
.setPropValue
in interface IPropCnr
name
- the name of the properties.newValue
- the new value to set for the propertyPropException
- when the new value doesn't validate correctly or
the property with specified name
is
not found.public boolean setPropValue(int index, Object newValue) throws PropException
index
to newValue
.setPropValue
in interface IPropCnr
index
- the index in the properties array.newValue
- the new value to set for the propertyPropException
- when the new value doesn't validate correctly.public int getPropCount()
getPropCount
in interface IPropCnr
public boolean containsProp(String name)
containsProp
in interface IPropCnr
name
- The property name.public boolean containsProp(Atom atom)
containsProp
in interface IPropCnr
atom
- The property atom.public GProp<?>[] getProps()
null
for an uninitialized value.public <GP> GP[] getProps(Class<GP> clazz)
public final <GP> int getAllProps(Class<GP> clazz, List<GP> list)
getAllProps
in interface IPropCnr
GP
- The property class requested.clazz
- The property classes to retrieve.list
- The list that is filled with the properties found of the specified class.public final int getAllProps(Class<?>[] classes, List<GProp<?>> list)
getAllProps
in interface IPropCnr
classes
- The array of property classes to retrieve.list
- The list that is filled with the properties found of the specified class.public final <GP> int getAllProps(Class<GP> clazz, List<GP> list, boolean includeErrors)
getAllProps
in interface IPropCnr
GP
- The property class requested.clazz
- The property classes to retrieve.list
- The list that is filled with the properties found of the specified class.includeErrors
- Flag to include properties containing errors.public final int getAllProps(Class<?>[] classes, List<GProp<?>> list, boolean includeErrors)
getAllProps
in interface IPropCnr
classes
- The array property classes to retrieve.list
- The list that is filled with the properties found of the specified class.includeErrors
- Flag to include properties containing errors.public final <GP> GP[] getAllProps(Class<GP> clazz)
getAllProps
in interface IPropCnr
GP
- The property class requested.clazz
- The property classes to retrieve.public final GProp<?>[] getAllProps(Class<? extends GProp<?>>... classes)
getAllProps
in interface IPropCnr
classes
- The list or array of property classes to retrieve.public final <GP> GP[] getAllProps(Class<GP> clazz, boolean includeErrors)
getAllProps
in interface IPropCnr
GP
- The property class requested.clazz
- The property classes to retrieve.includeErrors
- Flag to include properties containing errors.public final GProp<?>[] getAllProps(Class<?>[] classes, boolean includeErrors)
getAllProps
in interface IPropCnr
classes
- The array of property classes to retrieve.includeErrors
- Flag to include properties containing errors.public final GProp<?> getProp(Atom[] atomPath, int count)
public GProp<?> getProp(String name)
NullPointerException
may occur.public <GP extends IGProp<?>> GP getProp(String name, Class<GP> clazz)
NullPointerException
may occur.getProp
in interface IPropCnr
GP
- The property class requested.name
- the name of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.null
for uninitialized container
or the property with specified name is not found, or the class
type is not an instance of the specified class.public <GP extends IGProp<?>> GP getProp(String name, Class<GP> clazz, boolean logError)
NullPointerException
may occur.getProp
in interface IPropCnr
GP
- The property class requested.name
- the name of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.null
for uninitialized container
or the property with specified name is not found, or the class
type is not an instance of the specified class.public <GP extends IGProp<?>> GP getProp(Atom atom, Class<GP> clazz)
atom
name and checking the class instance of
the property. An error message is logged if the class is not matching.getProp
in interface IPropCnr
GP
- The property class requested.atom
- the atom of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.null
for uninitialized container
or the property with specified name is not found, or the class
type is not an instance of the specified class.public <GP extends IGProp<?>> GP getProp(Atom atom, Class<GP> clazz, boolean logError)
atom
name and checking the class instance of
the property.getProp
in interface IPropCnr
GP
- The property class requested.atom
- the atom of the property to locate in this property container.clazz
- the class the property must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.null
for uninitialized container
or the property with specified name is not found, or the class
type is not an instance of the specified class.public GProp<?> getFirstProp(String name)
getFirstProp
in interface IPropCnr
name
- The name of the property to locate in the tree.null
for uninitialized container
or the property with specified name is not found.public GProp<?> getFirstProp(Atom atom)
getFirstProp
in interface IPropCnr
atom
- The atom of the property to locate in the tree.null
for uninitialized container
or the property with specified atom is not found.public GProp<?> getProp(int index)
index
.public Object getPropValue(Atom atom)
atom
name.getPropValue
in interface IPropCnr
atom
- the atom of the property to locate in the array.null
for uninitialized container
or the property with specified name is not found.public final <VALUE> VALUE getPropValue(Atom atom, Class<VALUE> clazz)
atom
name.
An error is logged if the value is not of specified class.getPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.atom
- the atom of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.null
for uninitialized container
or the property with specified name is not found.public final <VALUE> VALUE getPropValue(Atom atom, Class<VALUE> clazz, boolean logError)
atom
name.getPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.atom
- the atom of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.null
for uninitialized container
or the property with specified name is not found.public final Object getPropValue(String name)
name
.getPropValue
in interface IPropCnr
name
- the name of the property to locate in the array.null
for uninitialized container
or the property with specified name is not found.public final <VALUE> VALUE getPropValue(String name, Class<VALUE> clazz)
name
.
An error is logged if the value is not of specified class.getPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.name
- the name of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.null
for uninitialized container
or the property with specified name is not found.public final <VALUE> VALUE getPropValue(String name, Class<VALUE> clazz, boolean logError)
name
.getPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.name
- the name of the property to locate in the array.clazz
- the class the property value must be or extend, null for no checking.logError
- logs an error message if the property is of a different type.null
for uninitialized container
or the property with specified name is not found.public final Object getPropValue(int index)
index
.getPropValue
in interface IPropCnr
index
- the index of the property in the array.null
for uninitialized container
or the property with specified name is not found.public <VALUE> boolean setPropValue(String name, VALUE value, Class<? extends GProp<VALUE>> propClass)
setPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.name
- The name of the property.value
- The value to set, null to remove the property.propClass
- The property class.InternalError
- If the property could not be removed or set due to errors.public <VALUE> boolean setPropValue(Atom atom, VALUE value, Class<? extends GProp<VALUE>> propClass)
setPropValue
in interface IPropCnr
VALUE
- The value class of the property requested.atom
- The atom name of the property.value
- The value to set, null to remove the property.propClass
- The property class.InternalError
- If the property could not be removed or set due to errors.public final int getPropIndex(IGProp<?> property)
getPropIndex
in interface IPropCnr
property
- The property who's index is to be located.public final int getPropIndex(Atom atom)
getPropIndex
in interface IPropCnr
atom
- The atom to look-up.public final Atom createUniqueAtom(String baseName)
createUniqueAtom
in interface IPropCnr
baseName
- The base name for the property. A numeric value is appended to the
name to make it unique.baseName
requested, appended with a numeric
value, making this atom unique within this property container.public final Atom createUniqueAtom(String baseName, String adder)
baseName
- The base name for the property. A numeric value is appended to the
name to make it unique.adder
- String to add before the number if baseName
was taken.baseName
requested, appended with a numeric
value, making this atom unique within this property container.public final Atom createUniqueAtom(Atom name, String first, String next, String next2)
createUniqueAtom
in interface IPropCnr
name
- The name of the property.first
- The first appended string, e.g. "Copy of ".next
- The next appended string, e.g. "Copy ". The next and next2 are used to append string, e.g. "Copy 2 of NNN".next2
- The next #2 appended string, e.g. " of ".baseName
requested, appended with a numeric
value, making this atom unique within this property container.public final Atom createCopyOfAtom(Atom name)
createCopyOfAtom
in interface IPropCnr
name
- Input name.public final boolean setProp(IGProp<?> property) throws PropException
setProp
in interface IPropCnr
property
- Property to set.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean setProp(IGProp<?> property, IGProp<?> trigger) throws PropException
setProp
in interface IPropCnr
property
- Property to set.trigger
- The trigger, or null for none.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean setProp2(IGProp<?> property)
InternalError
is thrown.public final boolean setProp2(IGProp<?> property, IGProp<?> trigger)
InternalError
is thrown.public final boolean addProp(IGProp<?> property) throws PropException
addProp
in interface IPropCnr
property
- the property to insert.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean addProp(IGProp<?> property, IGProp<?> trigger) throws PropException
addProp
in interface IPropCnr
property
- the property to insert.trigger
- The trigger, or null for none.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean addProp2(IGProp<?> property)
This method doesn't throw a PropException, but InternalError. It is intended to be used when the property can be added without exception, e.g. in a new container.
public final boolean addProp2(IGProp<?> property, IGProp<?> trigger)
This method doesn't throw a PropException, but InternalError. It is intended to be used when the property can be added without exception, e.g. in a new container.
public final boolean setProp(IGProp<?> property, int index) throws PropException
setProp
in interface IPropCnr
property
- the property to set.index
- the index to use if property is inserted.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean insertProp(IGProp<?> property, int index) throws PropException
insertProp
in interface IPropCnr
property
- the property to insert.index
- index where to insert the property.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.protected void onInsertProp(GProp<?> aProperty, int index, boolean replace, boolean isCloning, PropMgr propMgr, boolean isMoving) throws PropException
insertProp
is called to verify that this is allowed.
This method is typically used for the runtime virtuals container in the server.aProperty
- The property to insert.index
- Index where to insert the property.replace
- Flag indicating if the value should be replaced or not.isCloning
- Flag indicating this property is being cloned.propMgr
- The property manager for remote change, null for local.isMoving
- Flag indicating the property is moved.PropException
- when the property has a duplicate property name or
if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(IGProp<?> property) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
property
- the property to remove.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(IGProp<?> property, IGProp<?> trigger) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
property
- The property to remove.trigger
- The trigger property, null for none.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(IGProp<?> property)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
property
- The property to remove.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(IGProp<?> property, IGProp<?> trigger)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
property
- The property to remove.trigger
- The trigger property, null for none.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(String name) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
name
- The name of the property to remove.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(String name, IGProp<?> trigger) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
name
- The name of the property to remove.trigger
- The trigger property, null for none.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(String name)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
name
- The name of the property to remove.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(String name, IGProp<?> trigger)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
name
- The name of the property to remove.trigger
- The trigger property, null for none.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(Atom atom) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
atom
- The atom of the property to remove.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(Atom atom, IGProp<?> trigger) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
atom
- The atom of the property to remove.trigger
- The trigger property, null for none.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(Atom atom)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
atom
- The atom of the property to remove.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp2(Atom atom, IGProp<?> trigger)
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp2
in interface IPropCnr
atom
- The atom of the property to remove.trigger
- The trigger property, null for none.InternalError
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public final boolean removeProp(int index) throws PropException
Note: removing a property automatically disposes of it, so there is
no need to call dispose()
on it.
removeProp
in interface IPropCnr
index
- the index of the property to remove.PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.protected void onPropRemoved(GProp<?> prop, PropMgr propMgr, boolean isMoving)
prop
- The property being removed.propMgr
- The property manager, null for local.isMoving
- Moving flag, i.e. the property is moved within containers.public boolean removeAllProps() throws PropException
Note: removing properties automatically disposes of them, so there is
no need to call dispose()
on them.
removeAllProps
in interface IPropCnr
PropException
- if structural changes in containers is prohibited due
to creation-ship of container and who is requesting the
structural change.public void replaceProps(PropCnr cnr) throws CloneNotSupportedException, PropException
cnr
- The property container.CloneNotSupportedException
- For cloning errors.PropException
- If the properties could not be replaced.public final Atom[] getPropIndexes()
getPropIndexes
in interface IPropCnr
public final boolean reorderProps(Atom[] atoms) throws PropException
reorderProps
in interface IPropCnr
atoms
- The array of the properties atoms.PropException
- When the atoms does not correspond to the properties.public boolean hasSendData()
protected void appendPropValue(PropMgr propertyManager, Transaction trans, Object value)
appendPropValue
in class GProp<GProp<?>[]>
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.protected boolean initializeValue(PropMgr propertyManager, Transaction trans) throws ClassNotFoundException, InstantiationException, IllegalAccessException, PropException
initializeValue
in class GProp<GProp<?>[]>
propertyManager
- the property manager.trans
- the transaction to initialize the property with.ClassNotFoundException
- - if the class could not be found.IllegalAccessException
- - if the class or its nullary constructor is not accessible.InstantiationException
- - if this Class represents an abstract class, an interface,
an array class, a primitive type, or void; or if the class
has no nullary constructor; or if the instantiation fails for
some other reason.ExceptionInInitializerError
- - if the initialization provoked by this method fails.SecurityException
- - if a security manager, s, is present and any of the following
conditions is met:
PropException
- - if the property cannot be initialized, because of erroneous data.protected void logPropNotFound(String msg)
By default a WARNING message is logged.
msg
- The message.public void initializeProp(Element element) throws PropException
Element
.
The property should initialize itself from attributes and nodes
with appropriate information.
This call does nothing in this class and should be overridden by subclasses wishing for special processing.
initializeProp
in class GProp<GProp<?>[]>
element
- The Element
.PropException
- when the initialization fails.public void onPropTreeInitialized() throws IOException, PropException
The PropertyContainer
calls all its children with this method in order to inform
the tree.
The ExtendablePropertyContainer
overrides this method to load all extended
containers.
onPropTreeInitialized
in interface IGProp<GProp<?>[]>
onPropTreeInitialized
in class GProp<GProp<?>[]>
IOException
- For file errors.PropException
- When there is an initialization problem.protected void initializeElement(Element element)
This call does nothing in this class and should be overridden by subclasses wishing for special processing.
initializeElement
in class GProp<GProp<?>[]>
element
- The Element
to initialize.protected boolean shouldCreateProps(Element element)
super.shouldCreateProps(element)
) if the
container creates other child elements.element
- The element in question.protected GProp<?> convertLoadedProp(GProp<?> childProp)
This method is typically used to process changes of e.g. property types, e.g. from IntProp to NumberProp, in case of a change of property definitions.
childProp
- The child property that is about to be added.childProp
.public String toElementString(Object value)
initializeProperty(Element element)
method
once the element String is retrieved from the first child node of type "#text".
Override this method to provide the appropriate Object
to
String
conversion.
The default implementation returns the Object value.toString()
return code.
toElementString
in interface IGProp<GProp<?>[]>
toElementString
in class GProp<GProp<?>[]>
value
- the value in the object to convert to a string.protected Object equalsTree(PropCnr pc2, int how)
NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.
equalsTree
in class GProp<GProp<?>[]>
pc2
- The property value to compare with.how
- Flags EQC_* values for equal checking.protected Object equalsTree(PropCnr pc2, Class<? extends GProp<?>> arrayItemClass, int how)
NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.
pc2
- The property value to compare with.how
- Flags EQC_* values for equal checking.protected boolean doPropEqualsArrayValues()
protected Object getPropValue0(Object value, int index) throws Exception
getPropValue0
in class GProp<GProp<?>[]>
value
- The property value.index
- The index in the Class array returned by getValueClasses()
.IllegalArgumentException
- Invalid index, this should never happen though.Exception
- Other exceptions that could occur.protected Object toNativeValue0(Object value, int index) throws Exception
setPropertyValue
method
into the most preferred property value type. If the input value already is of the preferred type, the
same object is returned.toNativeValue0
in class GProp<GProp<?>[]>
value
- The input value to convert to native value.index
- The index in the array returned by getValueClasses()
, or -1 if not found.IllegalArgumentException
- Invalid index, this should never happen though.Exception
- For conversion exceptions.protected String paramString()
paramString
in class GProp<GProp<?>[]>
public void list(PrintStream out, int indent)
public void list(PrintWriter out, int indent)
public final String getString(String name, String defaultValue)
public final String getString(Atom atom)
public final String getString(Atom atom, String defaultValue)
public final boolean setString(Atom atom, String value)
value
in this property container.
If the string property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setString(String name, String value)
value
in this property container.
If the string property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setString(Atom atom, String value, boolean logError)
value
in this property container.
If the string property doesn't exist, it is created and added to this property container.
public final boolean setString(Atom atom, String value, boolean logError, IGProp<?> trigger)
value
in this property container.
If the string property doesn't exist, it is created and added to this property container.
setString
in interface IPropCnr
atom
- The atom of the property.value
- The string value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, null for none.public final int getInt(String name)
public final int getInt(String name, int defaultValue)
public final int getInt(Atom atom)
public final int getInt(Atom atom, int defaultValue)
public final boolean setInt(Atom atom, int value)
value
in this property container.
If the integer property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setInt(String name, int value)
value
in this property container.
If the integer property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setInt(Atom atom, int value, boolean logError)
value
in this property container.
If the integer property doesn't exist, it is created and added to this property container.
public final long getLong(String name)
public final long getLong(String name, long defaultValue)
public final long getLong(Atom atom)
public final long getLong(Atom atom, long defaultValue)
public final boolean setLong(Atom atom, long value)
value
in this property container.
If the long property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setLong(String name, long value)
value
in this property container.
If the long property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setLong(Atom atom, long value, boolean logError)
value
in this property container.
If the integer property doesn't exist, it is created and added to this property container.
public final boolean setLong(Atom atom, long value, boolean logError, IGProp<?> trigger)
value
in this property container.
If the integer property doesn't exist, it is created and added to this property container.
setLong
in interface IPropCnr
atom
- The atom of the property.value
- The integer value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, or null for none.public final double getNumber(String name)
public final double getNumber(String name, double defaultValue)
public final double getNumber(Atom atom)
public final double getNumber(Atom atom, double defaultValue)
public final boolean setNumber(Atom atom, double value)
value
in this property container.
If the Number property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setNumber(String name, double value)
value
in this property container.
If the Number property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setNumber(Atom atom, double value, boolean logError)
value
in this property container.
If the Number property doesn't exist, it is created and added to this property container.
public final boolean setNumber(Atom atom, double value, boolean logError, IGProp<?> trigger)
value
in this property container.
If the Number property doesn't exist, it is created and added to this property container.
setNumber
in interface IPropCnr
atom
- The atom of the property.value
- The Number value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property, null for none.public final boolean getBool(String name)
public final boolean getBool(String name, boolean defaultValue)
public final boolean getBool(Atom atom)
public final boolean getBool(Atom atom, boolean defaultValue)
public final boolean setBool(Atom atom, boolean value)
value
in this property container.
If the boolean property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setBool(String name, boolean value)
value
in this property container.
If the boolean property doesn't exist, it is created and added to this property container.
If the property cannot be set, an warning message is logged.
public final boolean setBool(Atom atom, boolean value, boolean logError)
value
in this property container.
If the boolean property doesn't exist, it is created and added to this property container.
public final boolean setBool(Atom atom, boolean value, boolean logError, IGProp<?> trigger)
value
in this property container.
If the boolean property doesn't exist, it is created and added to this property container.
setBool
in interface IPropCnr
atom
- The atom of the property.value
- The boolean value.logError
- Flag indicating if a warning event should be logged for failures.trigger
- The trigger property or null for none.public IFocusEngine getFocusEngine(IFocusComp comp)
getFocusEngine
in interface IPropCnr
comp
- The component requesting the focus engine.public String canRequestFocus()
null
for success,
or other error message.
Default processing is to return "Component not focusable"
if the component doesn't implement the IFocusComp
interface,
"Not virtualized" if the component is not in a virtualized state,
or null
otherwise.
canRequestFocus
in interface IPropCnr
null
focus is possible to this component,
or an error message describing why focus cannot be requested.public String couldRequestFocusIfVirtualized(boolean ignoreStates)
null
for success,
or other error message.
Default processing is to return "Component not focusable"
if the component doesn't implement the IFocusComp
interface
or null
otherwise.
couldRequestFocusIfVirtualized
in interface IPropCnr
ignoreStates
- Flag indicating that states should be ignored,
such as visible or enabled. If false, hidden or
disabled components return an error message.null
focus is possible to this component,
or an error message describing why focus cannot be requested.public String requestFocus(IGProp<?> trigger, boolean isRemoteInduced)
This method is less precise than requestFocusEx(IGProp, boolean, IFocusVetoListener)
,
but avoids try-catching.
This method is implemented in PropCnr
, but should only be called
for IFocusComp
implementing property classes. This method will return
"Component not focusable" if called on a non-focus component.
requestFocus
in interface IPropCnr
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.null
for success, otherwise an error message indicating why focus
was not able to be changed.public boolean requestFocusEx(IGProp<?> trigger, boolean isRemoteInduced) throws FocusException
This method is implemented in PropCnr
, but should only be called
for IFocusComp
implementing property classes. This method will throw
FocusException
with message "Component not focusable" if called on a
non-focus component.
requestFocusEx
in interface IPropCnr
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.FocusException
- If focus could not be changed.protected String requestFocus(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback)
This method is less precise than requestFocusEx(IGProp, boolean, IFocusVetoListener)
,
but avoids try-catching.
This method is implemented in PropCnr
, but should only be called
for IFocusComp
implementing property classes. This method will return
"Component not focusable" if called on a non-focus component.
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.callback
- Optional callback that may throw a veto exception, null for none.
This callback is intended to perform focus changes in the tree,
typically for UI containers.null
for success, otherwise an error message indicating why focus
was not able to be changed.protected boolean requestFocusEx(IGProp<?> trigger, boolean isRemoteInduced, IFocusVetoListener callback) throws FocusException
This method is implemented in PropCnr
, but should only be called
for IFocusComp
implementing property classes. This method will throw
FocusException
with message "Component not focusable" if called on a
non-focus component.
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.callback
- Optional callback that may throw a veto exception, null for none.
This callback is intended to perform focus changes in the tree,
typically for UI containers.FocusException
- If focus could not be changed.public boolean hasFocus()
protected PropCnr getRetargetedVerifyContainer()
null
.public final int verifyInternalUseOnly(Set<PropCnr> currentlyBeingVerifiedPropCnrs)
To request a verification, use com.iizigo.editor#queueVerify(PropCnr)
or
com.iizigo.editor#doVerify(PropCnr)
instead.
This method will warn if called for a property not having the parent of FileURIPropCnr
,
FolderURIPropCnr
or a root property.
currentlyBeingVerifiedPropCnrs
- The synchronized set of properties currently being verified.public ErrorsProp getErrorsProp(boolean createIfNotPresent)
getErrorsProp
in interface IPropCnr
createIfNotPresent
- Set to true to create the property if it's not present.public final int getChildPropErrorSeverity(Atom atom)
getChildPropErrorSeverity
in interface IPropCnr
atom
- The atom name of the child property.public final int getChildPropErrorSeverity(String name)
getChildPropErrorSeverity
in interface IPropCnr
name
- The name of the child property.public IPropErrorItem getChildPropError(Atom atom)
getChildPropError
in interface IPropCnr
atom
- The atom name of the child property.public IPropErrorItem getChildPropError(String name)
getChildPropError
in interface IPropCnr
name
- The name of the child property.public int getReferences(List<Reference> references)
getReferences
in interface IGProp<GProp<?>[]>
getReferences
in class GProp<GProp<?>[]>
references
- The references array is filled in by this method.public void verify(PropVerification verification)
verify
method.public List<String> verifyTree()
public final boolean isChild(IGProp<?> prop)
public final boolean isSibling(IGProp<?> prop)
public Class<?>[] getPossibleChildren()
getPossibleChildren
in interface IPropCnr
public boolean validateClassInstances(boolean doPerform, GProp<?>[] props, boolean isMove)
Override this method that by default returns true to provide fine-tuned testing for validity.
validateClassInstances
in interface IPropCnr
doPerform
- The perform flag, false means just testing.props
- Properties to move or paste.isMove
- Flag for move if true, false means paste.public VSReference getVSReference(Atom refAtom)
VSRelativeReference
to look up the VSReference
instance in order to resolve the relative path to the target property.
This method needs to be overridden by subclasses of PropCnr
that has
a VSReference as property, e.g. the JSONInProp
class in the Web Service plug-in.
The default is to re-target the call to the parent container, and if the root, a folder or
a file property is reached, null
is returned.
getVSReference
in interface IGProp<GProp<?>[]>
getVSReference
in class GProp<GProp<?>[]>
refAtom
- The property asking for the VSReference.VSReference
or null
if unassigned.
The returned instance could also be a VSParticipant and should therefore
be processed accordingly.public VSReference createVSReference(Atom refAtom, PropCnr[] returnParent)
VSRelativeReference
to look up the VSReference
instance in order
to resolve the relative path to the target property.
This method needs to be overridden by subclasses of PropCnr
that has
a VSReference as property, and *SHOULD* match getVSReference(Atom)
.
The default is to re-target the call to the parent container, and if the root, a folder or
a file property is reached, null
is returned.
refAtom
- The property asking for the VSReference.returnParent
- An array of PropCnr [1] that will be filled in with the parent property of
the VSRefernce.VSReference
created or null
if impossible.
The instance has NOT been added to any container, i.e. is orphan.public PropCnr getPropBaseReference()
PropRelativeReference
to look up the reference
instance in order to resolve the relative path to the target property.
This method needs to be overridden by subclasses of PropCnr
that has
a PropRelativeReference as property, e.g. the ScreenProp
class in the Terminal Core plug-in.
The default is to re-target the call to the parent container, and if the root, a folder or
a file property is reached, null
is returned.
getPropBaseReference
in interface IGProp<GProp<?>[]>
getPropBaseReference
in class GProp<GProp<?>[]>
PropCnr
or null
if unassigned.public void resolveRuntimeReferences(IRuntimeResolver resolver)
This call is propagated in the entire client tree.
resolveRuntimeReferences
in interface IGProp<GProp<?>[]>
resolveRuntimeReferences
in class GProp<GProp<?>[]>
resolver
- The reference resolver.public Class<?>[] getExtendsPossibleClasses()
getExtendsPossibleClasses
in interface IPropCnr
public boolean isExtendsPropertyValid(GProp<?> property)
property
- The property to validate.public boolean setExtendsName(String newName) throws PropException
setExtendsName
in interface IPropCnr
newName
- The new extends from property, null to clear.PropException
- If called from the Server or Client, or if this property container
doesn't support the Extends Framework.public String getExtendsName()
getExtendsName
in interface IPropCnr
public String getExtendsError()
getExtendsError
in interface IPropCnr
public boolean setExtendsOverride(Atom atom, boolean on)
setExtendsOverride
in interface IPropCnr
atom
- The atom to override.on
- When set, adds this as being an overridden property. When cleared, removes the
property from being overridden.public boolean isExtendsOverriden(Atom atom)
isExtendsOverriden
in interface IPropCnr
atom
- The atom to override.public boolean initializeExtendsFramework(GEvent triggerEvent) throws PropException
setExtendsName
.
If an exception occurs, use getExtendsError()
to get the error message.
initializeExtendsFramework
in interface IPropCnr
triggerEvent
- The event that triggered this reference event, null for none.PropException
- An exception for initializing errors (e.g. invalid reference,
invalid properties).public Atom[] getExtendsOverride()
public final boolean isExtendsRoot()
isExtendsRoot
in interface IPropCnr
public PropCnr getExtendsContainer()
iizi® is a registered trademark of Mindus SARL. © Copyright 2019 Mindus SARL. All rights reserved.