Package com.iizix.prop
Class ConstrainedIntProp
- java.lang.Object
- com.iizix.prop.GProp<java.lang.Integer>
- com.iizix.prop.IntProp
- com.iizix.prop.ConstrainedIntProp
- All Implemented Interfaces:
EventListener
,IGProp<java.lang.Integer>
,java.lang.Cloneable
public class ConstrainedIntProp extends IntProp
This class is used to hold an integer property that has constraints imposed on it. The constraints string is in the format "token,token2,..." where a "token" can be either an integer value or a "range" in the format "min:max". An example for a horizontal position 4,5,6 for left, center, right and 0 (zero) for uninitialized would have the form "0,4-6" or "0,4,5,6".- Author:
- Christopher Mindus
Field Summary
Fields inherited from class com.iizix.prop.GProp
GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2
Fields inherited from interface com.iizix.prop.IGProp
EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Constructor Summary
Constructors Modifier Constructor Description protected
ConstrainedIntProp()
Creates the component without a name and no constraints.ConstrainedIntProp(Atom propertyAtom, java.lang.String constraints)
Creates the component with the specified name.ConstrainedIntProp(Atom propertyAtom, java.lang.String constraints, int newValue)
Creates the component with the specified name, initialized to contain theGProp
items.protected
ConstrainedIntProp(java.lang.String constraints)
Creates the component without a name.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getConstraints()
Gets the constraints string for this property.void
setConstraints(java.lang.Object constraints, java.lang.String prevConstraints, org.w3c.dom.Element prevElement)
Sets the constraints for the property previously returned from the same constraints call tosetConstraints(String,Element)
with the same String and Element as this instance would require.java.lang.Object
setConstraints(java.lang.String constraints, org.w3c.dom.Element element)
Sets the constraints for the property.void
validatePropValue(java.lang.Object newValue)
Validates the value to set.Methods inherited from class com.iizix.prop.IntProp
appendPropValue, fromElementString, getInt, getInt, getPropValue0, getValueClasses, initializeValue, setPropValue, toNativeValue0, validatePropType
Methods inherited from class com.iizix.prop.GProp
addPropError, addPropListener, clone, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalsTree, equalValues, extendsClone, finalize, fine, fine, finer, finer, finest, finest, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropBaseReference, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferences, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParent, getTreeLock, getVSReference, hasChanged, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeElement, initializeGElement, initializeGProp, initializeProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, 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, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropDispose, onPropInvalidateCache, onPropParentChanged, onPropTreeInitialized, onPropValueSet, onReferenceEvent, onRemoteEvent, onVirtualizationCompleted, onVirtualized, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, resolveRuntimeReferences, setChanged, setCreateRequiredProp, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toElementString, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, verify, verifyHasPropertyItem, virtualize, warning, warning, warning
Constructor Detail
ConstrainedIntProp
protected ConstrainedIntProp()
Creates the component without a name and no constraints. The name and constraints must be set in all cases using thesetPropertyAtom
andsetConstraints
calls.
ConstrainedIntProp
protected ConstrainedIntProp(java.lang.String constraints) throws PropException
Creates the component without a name. The name must be set in all cases using thesetPropertyAtom
call.- Parameters:
constraints
- The constraints string from the properties definition.- Throws:
PropException
- For property constraints errors.
ConstrainedIntProp
public ConstrainedIntProp(Atom propertyAtom, java.lang.String constraints) throws PropException
Creates the component with the specified name. All system-reserved names for components begins with "$".- Parameters:
propertyAtom
- the name of the component, unique within it's parent.constraints
- The constraints string from the properties definition.- Throws:
PropException
- For property constraints errors.
ConstrainedIntProp
public ConstrainedIntProp(Atom propertyAtom, java.lang.String constraints, int newValue) throws PropException
Creates the component with the specified name, initialized to contain theGProp
items. All system-reserved names for components begins with "$".- Parameters:
propertyAtom
- The name of the component, unique within it's parent.constraints
- The constraints string from the properties definition.newValue
- The alignment property value (1-9).- Throws:
PropException
Method Detail
setConstraints
public java.lang.Object setConstraints(java.lang.String constraints, org.w3c.dom.Element element) throws PropException
Sets the constraints for the property.This method must be overridden by subclasses in order to load the constraints properly if the constraints-string is not sufficient, i.e. that additional settings must be loaded from the XML Element.
- Specified by:
setConstraints
in interfaceIGProp<java.lang.Integer>
- Overrides:
setConstraints
in classGProp<java.lang.Integer>
- Parameters:
constraints
- The constraints string from the properties definition.element
- The Element that loads the property class from the properties definition. Note that Element may benull
if the constructor isn't called from the PropertyFactory.- Returns:
- The constraints object for reuse by the
PropertyFactory
with a subsequentsetConstraints(Object)
call instead of to this method. - Throws:
PropException
- For errors in the constraints definitions.
setConstraints
public void setConstraints(java.lang.Object constraints, java.lang.String prevConstraints, org.w3c.dom.Element prevElement) throws PropException
Sets the constraints for the property previously returned from the same constraints call tosetConstraints(String,Element)
with the same String and Element as this instance would require.This method must be overridden by subclasses in order to load the constraints properly if the constraints-string is not sufficient, i.e. that additional settings must be loaded from the XML Element.
- Specified by:
setConstraints
in interfaceIGProp<java.lang.Integer>
- Overrides:
setConstraints
in classGProp<java.lang.Integer>
- Parameters:
constraints
- The constraints Object from the properties definition.prevConstraints
- The previous constraints string from the properties definition.prevElement
- The previous Element that loads the property class from the properties definition.- Throws:
PropException
- For errors in the constraints definitions.
getConstraints
public java.lang.String getConstraints()
Gets the constraints string for this property.- Specified by:
getConstraints
in interfaceIGProp<java.lang.Integer>
- Overrides:
getConstraints
in classGProp<java.lang.Integer>
- Returns:
- The constraints string used to in
setConstraints
to initiate the constraints for this property.
validatePropValue
public void validatePropValue(java.lang.Object newValue) throws PropException
Validates the value to set.Note: When this method is called, synchronization is done at the property itself, so no synchronization on the tree should be done.
- Specified by:
validatePropValue
in interfaceIGProp<java.lang.Integer>
- Overrides:
validatePropValue
in classGProp<java.lang.Integer>
- Parameters:
newValue
- The new value to set.- Throws:
PropException
- when the new value doesn't validate correctly.