Class UIComp
- All Implemented Interfaces:
EventListener
,IMessageBox
,IComponent
,ICustomDataProvider
,IGProp<GProp<?>[]>
,IPropCnr
,IUIComp
,IVSComponentListener
,IVSComponentState
,IVSFieldListener
,Cloneable
- Direct Known Subclasses:
AbstractUIAction
,CalendarEvent
,MapMarkerProp
,MUISwitch
,UIAbstractListChoice
,UICalendar
,UIChart
,UICheckBox
,UICheckedMenuItem
,UIContainer
,UIDateTime
,UIEmpty
,UIGauge
,UIImage2
,UILabel
,UIMedia
,UIMenuSeparator
,UIOutput
,UIProgress
,UIRadioButton
,UIRadioMenuItem
,UISlider
,UITableColumn
,UIText
The component has a data container that is not persistent, i.e. is not written e.g. to disk.
- Author:
- Christopher Mindus
Nested Class Summary
Nested classes/interfaces inherited from interface com.iizix.gyro.IMessageBox
IMessageBox.Icon
Nested classes/interfaces inherited from interface com.iizix.prop.vs.IVSComponentState
IVSComponentState.State
Field Summary
Modifier and TypeFieldDescriptionstatic final UIComp[]
Empty array of components.protected static final int
Remote event for focus.protected Styles
The style container.protected VSField
The connected field, null for none.Fields inherited from class com.iizix.prop.PropCnr
EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID
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_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
Fields inherited from interface com.iizix.gyro.IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNING
Fields inherited from interface com.iizix.prop.ui.IUIComp
ERROR, INFORMATION, NONE, WARNING
Constructor Summary
ConstructorDescriptionUIComp()
Creates a property container with the specified name with a null value.Creates a property container with the specified name with a null value.Creates a property container with the specified name and properties.Method Summary
Modifier and TypeMethodDescriptionfinal void
Adds a component to the container with a property for the layout manager.protected void
addMappings
(VSMappings mappings, VSComponent vsStateFocus) Gets the mappings of a VirtualSpace to the panel components.static void
assignFontInfoResolver
(IFontInfo.Resolver resolver) Assigns the IFontInfo resolver.Returns if this container can accept focus itself or for one of its children components.boolean
Returns if the component can be aligned left, right, center, or horizontal fill.boolean
Returns if the component can be aligned top, bottom, middle or vertical fill.boolean
canFillX()
Returns if the component can fill in X or not.boolean
canFillY()
Returns if the component can fill in Y or not.Returns if this component can receive focus.canRequestFocus
(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag) Returns if this component can receive focus.boolean
Clears the error message, if any.clone()
Creates a clone out of this property.couldRequestFocusIfVirtualized
(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag) Returns if this component could receive focus if it would be virtualized.protected Styles
Creates the Styles container (can be overridden by Designer to create com.iizigo.style.prop.EditorStyles).protected GProp<?>
Creates the title property a StringProp, KStringProp or PlainKStringProp depending on the component.boolean
Disconnects from the VirtualSpace Field connection.protected boolean
Method to check if updates of this component's text and attributes should update the VS field.final boolean
enterVSProcessing
(VSComponent component) Call this method when the VSField or the text will update each other, in order to avoid recursion in event processing.final void
Call this routine to exit VSField processing routine that was entered usingenterVSProcessing(VSComponent)
.boolean
Fires the selection to the listeners if it is changed.protected boolean
fireSelection
(GEvent event) Fires the selection to the listeners if it is changed.forbiddenGetCustomDataMap
(boolean doCreate) Deprecated.abstract Size
Returns the size of the component in pixels.getBadge()
Gets the badge for the component.getBestVSFieldValueType
(VSRelativeReference<?> reference) Requests the value type that would best suit the listener.int
Creates or gets the unique ID within the panel for a component.final List<VSComponent>
Gets the mappings to VSComponent's for this component.Gets the current CSS class names assigned to this component.getErrorMessage
(ValueConversionException exception) Gets the localized error message for a validation exception.getErrorMessage
(ILocaleString localeString, ValueConversionException exception) Gets the localized error message for a validation exception.getErrorMessageEx
(ILocaleString localeString, Exception exception) Gets the localized error message for a validation exception of any kind of exception.getErrorMessageString
(ValueConversionException exception) Gets the localized error message for a validation exception.getErrorMessageString
(ILocaleString localeString, ValueConversionException exception) Gets the localized error message for a validation exception.getErrorMessageStringEx
(ILocaleString localeString, Exception exception) Gets the localized error message for a validation exception of any kind of exception.Gets the first VS component encountered for state and focus of this container or in the parent tree up to the panel level.int
Gets the designed fixed height of this component in pixels.int
Gets the designed fixed width of this component in pixels.Returns the font information from this component.int
Gets the default alignment in X when it is not supported, i.e.int
Gets the default alignment in Y when it is not supported, i.e.Gets the text from the control as aKString
.Gets the layout properties of this component.LayoutMgr<?>
Gets the layout manager for the component.<LAYOUT_MGR extends LayoutMgr<?>>
LAYOUT_MGRgetLayoutMgr
(Class<LAYOUT_MGR> layoutMgrClass) Gets the layout manager for the component.Gets the main component that is used to map the UI component to the VirtualSpace.Gets the current message for the component.Gets the current message text for the component as a plain string.int
Returns the height in pixel units of the component from the layout.int
Returns the width in pixel units of the component from the layout.void
Gets the references to predefined properties.getSize()
Returns the size of the component in pixels.final Styles
Gets the Styles property.final Styles
getStyles
(boolean doCreate) Gets the Styles property.final String
getText()
Gets the text.getTitle()
Get the title of the component (i.e.Gets the title of the component as a (Plain) KString (i.e.Gets the title of the component as a PlainKString (i.e.Gets the current tooltip for the component.Gets the current tooltip text for the component as a plain string.protected GProp<?>
getTrigger
(GEvent event) Gets the trigger from an event.final UIPanelBase
Gets the UIPanel.final UIContainer
Gets the parent container of this component.Gets the value from a property namedatom
.Gets the value from a property namedname
.Gets the VirtualSpace of the UI component.Gets the connected or disconnected VirtualSpace Field.Gets the VS component for state and focus of this component (always null) if the component is not a container.boolean
Verifies if the component has an implicit height.boolean
Verifies if the component has a width.boolean
hasFocus()
Returns if the component currently has focus.boolean
Returns if the component has implicit component horizontal fill.boolean
Returns if the component has implicit component vertical fill.boolean
Verifies if the component has an implicit height.boolean
Verifies if the component has a width.protected boolean
Checks if the selection has changed since last call to fireSelection.protected final void
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.protected void
invokeOnUICreateTree
(UIPanelBase panel) Invokes the onUICreate method for the component if a panel is present.final boolean
Get the enabled state of the component.boolean
isMobile()
Checks if the panel is of mobile type.final boolean
Get the read-only state of the component.boolean
isRTL()
Returns if the component is displayed in RTL or not.final boolean
Get the visibility state of the component.boolean
Checks if the connection state to the VirtualSpace Field is disconnected.boolean
Does this component require an explicitly defined height?boolean
Does this component require an explicitly defined width?boolean
Does this component require a height?boolean
Does this component require a width?void
onBroken
(VSRelativeReference<?> reference, VSField field) Called when the property reference has been broken, i.e.void
onComponentSelectedInParent
(boolean on) Called by the parent container to inform that this component has been selected in its container.void
onEventSelf
(GEvent event) Updates a VirtualSpace Field when a component text changes.void
onFocusGained
(IFocusComp opposite, IGProp<?> trigger, boolean isRemoteInduced) Called to the component when it receives focus.protected void
onNotifySelectionChanged
(GEvent event) Method called when the selection of the component has changed and has been verified to be different from a previous selection.void
onParentStateChanged
(IVSComponent parent, IVSComponentState.State state, boolean on) Called when the column changes state.protected void
onPrepare
(ClassReference cr, List<Throwable> errors) Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.protected void
onPrepare
(IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) Called when the application is being prepared.protected void
Called when a property is disposed of by delete/remove in a container, or by the dispose method.void
onRemoteEvent
(RemoteEvent event) Called when a remote property event should be processed by this property.void
onResolved
(VSRelativeReference<?> reference, VSField field) Called when the property reference has been resolved.protected void
onSelectionChanged
(GEvent event) Method called when the selection of the component changed due to a property change (value changed, property added or removed).void
onStateChanged
(VSField field, IVSComponentState.State state, boolean on) Called when the field changes state.void
onValueChanged
(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the field value is set.protected void
processVSComponentSelection
(VSComponent mappedComponent) Override to process the VS components selection state when Atom.SELECTED BoolProp changes.boolean
reconnectVSField
(boolean update) Reconnects to a previously disconnected VirtualSpace Field connection.Requests focus to this component.requestFocus
(boolean doAnimate) Requests focus to this component.requestFocus
(IGProp<?> trigger, boolean isRemoteInduced) Requests focus to this component.requestFocus
(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate) Requests focus to this component.boolean
Requests focus to this component.boolean
requestFocusEx
(boolean doAnimate) Requests focus to this component.boolean
requestFocusEx
(IGProp<?> trigger, boolean isRemoteInduced) Requests focus to this component.boolean
requestFocusEx
(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate) Requests focus to this component.void
Resets the component ID, typically when copied or saved in order to add make copies of the (some) component data.boolean
Sets or clears the badge of the component.boolean
Sets a red badge text with default font size for the component as a plain string.int
Sets the text or value from this text or value component to its VirtualSpace Field, if any.boolean
setCSSClassNames
(Collection<String> cssNames) Assigns a new collection of class names to the component.boolean
setCSSClassNames2
(Collection<String> cssNames) Assigns a new collection of class names to the component.final boolean
setEnabled
(boolean on) Sets the enabled state of the component.final boolean
setEnabled
(boolean on, IVSComponent trigger) Sets the enabled state of the component.void
setErrorMessage
(ValueConversionException exception) Transposes an exception from conversion to the component as an error message.void
setErrorMessage
(ILocaleString localeString, ValueConversionException exception) Transposes an exception from conversion to the component as an error message.boolean
setErrorMessage
(KString errorMessage) Sets (or removes) the ERROR message for the component.boolean
setErrorMessage
(String errorMessage) Sets (or removes) the ERROR message for the component.final boolean
setHTMLText
(String text) Sets the HTML text property KStringProp without tags processing.final LayoutMgr<?>
setLayoutMgr
(LayoutMgr<?> layoutManager) Sets the layout manager for the component.boolean
setMessage
(KTooltip message) Sets (or removes) the message for the component.boolean
setMessage
(String message, int category) Sets (or removes) a plain message string for the component with specified category.final boolean
setReadOnly
(boolean on) Sets the read-only state of the component.final boolean
setReadOnly
(boolean on, IVSComponent trigger) Sets the read-only state of the component.final boolean
Sets the HTML text property KStringProp Atom.TEXT ($text).final boolean
Sets the plain text property without tags processing.boolean
Get the title of the component (i.e.boolean
setTitle
(PlainKString str) Get the title of the component (i.e.boolean
Get the title of the component (i.e.boolean
setTooltip
(KTooltip tooltip) Sets (or removes) the tooltip for the component.boolean
setTooltip
(String text) Sets (or removes) the plain tooltip text for the component.setUIContainerFocus
(UIComp requestor, boolean doAnimate) Sets the focus to the UI container and all its parents.final boolean
setVisible
(boolean on) Sets the visibility state of the component.final boolean
setVisible
(boolean on, IVSComponent trigger) Sets the visibility state of the component.boolean
setVSFieldMessageToComponent
(VSField field, boolean clear) Sets the VirtualSpace Field's message to this component.void
setVSFieldToComponent
(VSField field) Method called when a VirtualSpace Field is resolved or when reconnection is done.boolean
verify
(PropVerification verification) Verifies this property container: component type must match panel type (desktop v/s mobile).protected boolean
verifyComponentScope
(UIContainer scopeContainer, String what, PropVerification verification, VSComponent vsOuter) Verifies that this component has it's VS references inside the outer VS reference.Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, completeVirtualize, containsProp, containsProp, convertLoadedProp, 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, 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, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, 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, 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, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verifyInternalUseOnly, verifyTree, virtualize
Methods inherited from class com.iizix.prop.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, 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, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onPropInvalidateCache, onPropParentChanged, onPropValueSet, 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, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.iizix.IComponent
messageBox
Methods inherited from interface com.iizix.prop.ICustomDataProvider
getCustomData, putCustomData, putCustomDataIfAbsent
Methods inherited from interface com.iizix.prop.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, getPropBaseReference, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCommunicating, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onPropTreeInitialized, removePropError, removePropListener, renameProp, resolveRuntimeReferences, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toElementString, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, validatePropType, validatePropValue, warning, warning, warning
Methods inherited from interface com.iizix.gyro.IMessageBox
messageBox, messageBox, messageBox
Methods inherited from interface com.iizix.prop.IPropCnr
addProp, addProp, addProp2, addProp2, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, enablePropCommunication, enablePropHashMap, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsError, getExtendsName, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropCnr, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getString, getString, getString, getString, initializeExtendsFramework, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsRoot, isPropAddRemoveAllowed, isPropExtended, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, setBool, setBool, setBool, setBool, 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, usePropHashMap, usesPropIndex, validateClassInstances
Methods inherited from interface com.iizix.prop.ui.IUIComp
getContainerFirstUIComponent, getContainerFirstUIComponentNull, getDeviceType, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIRef
Field Details
REMOTE_FOCUS_EVENT
protected static final int REMOTE_FOCUS_EVENTRemote event for focus.- See Also:
EMPTY
Empty array of components.styles
The style container.vsField
The connected field, null for none.Note: use thread-safe code when working with this variable as it can become unresolved, thus
null
.
Constructor Details
UIComp
public UIComp()Creates a property container with the specified name with a null value.UIComp
Creates a property container with the specified name with a null value.- Parameters:
propertyAtom
- the property atom.
UIComp
Creates a property container with the specified name and properties.- Parameters:
propertyAtom
- the property atom.properties
- the property array value for the property.- Throws:
PropException
- as structural changes in containers on client is prohibited.
Method Details
initPropCnr
protected final 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.UI components use the named property hash map for lookup of properties fast.
- Overrides:
initPropCnr
in classPropCnr
getPredefinedProps
public void getPredefinedProps()Gets the references to predefined properties. If the Styles is created, make sure to get it.- Overrides:
getPredefinedProps
in classPropCnr
forbiddenGetCustomDataMap
Deprecated.Gets or creates the provider map. This method is not intended to be called by user code, it is used by the system.Do not call this method!
- Specified by:
forbiddenGetCustomDataMap
in interfaceICustomDataProvider
- Parameters:
doCreate
- Creates the map if required.- Returns:
- The map or newly created map,
null
if not created.Note: the map returned is NOT synchronized thus not thread safe. It is up to the caller to synchronize on it to ensure thread safety.
clone
Creates a clone out of this property. The cloning is overridden by the subclasses in order to handle cloning of its class variables appropriately.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!
isMobile
public boolean isMobile()Checks if the panel is of mobile type.getUIParent
Gets the parent container of this component.- Specified by:
getUIParent
in interfaceIComponent
- Returns:
- null if none is present.
getUIPanel
Gets the UIPanel.- Specified by:
getUIPanel
in interfaceIComponent
- Returns:
- null if none is present.
getVirtualSpace
Gets the VirtualSpace of the UI component.- Specified by:
getVirtualSpace
in interfaceIUIComp
- Returns:
- The VirtualSpace, or null for none.
assignFontInfoResolver
Assigns the IFontInfo resolver.getFontInfo
Returns the font information from this component. This call can only be done in the Designer and will throw IllegalStateException in the Server.- Returns:
- The font information.
- Throws:
IllegalStateException
- If called from the Server in runtime (or outside the Designer).
hasImplicitAlignFillX
public boolean hasImplicitAlignFillX()Returns if the component has implicit component horizontal fill.- Returns:
- true means component will always fill the space in X, false otherwise.
hasImplicitAlignFillY
public boolean hasImplicitAlignFillY()Returns if the component has implicit component vertical fill.- Returns:
- true means component will always fill the space in Y, false otherwise.
getSize
Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).The method attempts to use the bounds settings if available. If not available, the size is retrieved from the potential settings of the layout data, and if that is not provided, the approximate size is used.
- Returns:
- The size of the component.
- Throws:
IllegalStateException
- If called outside of the Designer.
getApproximateSize
Returns the size of the component in pixels. The size is a calculation and does not exactly reflect the real size that may be different due to additional styles not taken into account by this method. The size is calculated from the font of the component and default or defined values (such as character length or number of lines for text area).- Returns:
- The size of the component.
- Throws:
IllegalStateException
- If called outside of the Designer, e.g. from the Server.
getPixelWidth
public int getPixelWidth()Returns the width in pixel units of the component from the layout.- Returns:
- -1 if width is not defined, otherwise the pixel width.
getPixelHeight
public int getPixelHeight()Returns the height in pixel units of the component from the layout.- Returns:
- -1 if height is not defined, otherwise the pixel height.
hasImplicitWidth
public boolean hasImplicitWidth()Verifies if the component has a width.This means a width that is either present due to the component or that the width has explicitly been set, or that it is in a container that sets the outer bounds of the component.
- Returns:
- true if the width is defined and non-zero, false otherwise.
hasImplicitHeight
public boolean hasImplicitHeight()Verifies if the component has an implicit height.This means a height that is either present due to the component or that the height has explicitly been set, or that it is in a container that sets the outer bounds of the component.
- Returns:
- true if the height is defined and non-zero, false otherwise.
hasExplicitWidth
public boolean hasExplicitWidth()Verifies if the component has a width.This means a width that is either present due to the component or that the width has explicitly been set, or that it is in a container that sets the outer bounds of the component.
- Returns:
- true if the width is defined and non-zero, false otherwise.
hasExplicitHeight
public boolean hasExplicitHeight()Verifies if the component has an implicit height.This means a height that is either present due to the component or that the height has explicitly been set, or that it is in a container that sets the outer bounds of the component.
- Returns:
- true if the height is defined and non-zero, false otherwise.
mustHaveWidth
public boolean mustHaveWidth()Does this component require a width?- Returns:
- true if the width must be defined and non-zero, false otherwise.
mustHaveHeight
public boolean mustHaveHeight()Does this component require a height?- Returns:
- true if the height must be defined and non-zero, false otherwise.
mustHaveExplicitWidth
public boolean mustHaveExplicitWidth()Does this component require an explicitly defined width?- Returns:
- true if the width must be defined and non-zero, false otherwise.
mustHaveExplicitHeight
public boolean mustHaveExplicitHeight()Does this component require an explicitly defined height?- Returns:
- true if the height must be defined and non-zero, false otherwise.
canFillX
public boolean canFillX()Returns if the component can fill in X or not.- Returns:
- true (default) for fill supported, false otherwise (e.g. for a checkbox).
canFillY
public boolean canFillY()Returns if the component can fill in Y or not.- Returns:
- true (default) for fill supported, false otherwise (e.g. for a checkbox).
canAlignX
public boolean canAlignX()Returns if the component can be aligned left, right, center, or horizontal fill.- Returns:
- true by default, components override to return false if they are fixed in width or take up the entire width.
canAlignY
public boolean canAlignY()Returns if the component can be aligned top, bottom, middle or vertical fill.- Returns:
- true by default, components override to return false if they are fixed in height or take up the entire height.
getForcedAlignX
public int getForcedAlignX()Gets the default alignment in X when it is not supported, i.e.canAlignX()
returns false.- Returns:
- 1=left, 2=center, 3=right, 4=fill (default value), or -1 for failure: align not possible.
getForcedAlignY
public int getForcedAlignY()Gets the default alignment in Y when it is not supported, i.e.canAlignY()
returns false.- Returns:
- 1=top, 2=middle, 3=bottom, 4=fill (default value), or -1 for failure: align not possible.
getFixWidth
public int getFixWidth()Gets the designed fixed width of this component in pixels.- Specified by:
getFixWidth
in interfaceIUIComp
- Returns:
- Zero (default) for not fixed.
getFixHeight
public int getFixHeight()Gets the designed fixed height of this component in pixels.- Specified by:
getFixHeight
in interfaceIUIComp
- Returns:
- Zero (default) for not fixed.
getComponentID
public int getComponentID()Creates or gets the unique ID within the panel for a component. This ID can be used as the HTML ID and is used by the LabelForReference.- Specified by:
getComponentID
in interfaceIUIComp
- Returns:
- A unique number for a component in a panel.
resetComponentID
public void resetComponentID()Resets the component ID, typically when copied or saved in order to add make copies of the (some) component data. The operation is recursive.getStyles
Gets the Styles property. If it doesn't exist, it is created.- Specified by:
getStyles
in interfaceIComponent
- Returns:
- The Styles property container or null for none.
getStyles
Gets the Styles property. If it doesn't exist, it is created depending on thedoCreate
flag.- Returns:
- The Styles property container or null for none.
createStyles
Creates the Styles container (can be overridden by Designer to create com.iizigo.style.prop.EditorStyles).getCSSClassNames
Gets the current CSS class names assigned to this component.- Specified by:
getCSSClassNames
in interfaceIUIComp
- Returns:
null
for none, or the class names separated by spaces.
setCSSClassNames
public boolean setCSSClassNames(Collection<String> cssNames) throws IllegalArgumentException, PropException Assigns a new collection of class names to the component. Use {@link Collections.emptyList()} if you wish to remove all the class names.A valid CSS class name consists of a string with the characters 'a-z', 'A-Z', '0-9' or '-_' and cannot start with a digit.
- Specified by:
setCSSClassNames
in interfaceIUIComp
- Parameters:
cssNames
- A collection of Strings for the class names.- Returns:
true
if modified,false
for no change.- Throws:
IllegalArgumentException
- If one of the class names are invalid.PropException
- If there was a property error setting the class names.
setCSSClassNames2
Assigns a new collection of class names to the component. Use {@link Collections.emptyList()} if you wish to remove all the class names.A valid CSS class name consists of a string with the characters 'a-z', 'A-Z', '0-9' or '-_' and cannot start with a digit.
This method is the same as calling
setCSSClassNames(java.util.Collection<java.lang.String>)
but with a try-catch that logs a warning message in case thePropException
occurs and then returnsfalse
- Specified by:
setCSSClassNames2
in interfaceIUIComp
- Parameters:
cssNames
- A collection of Strings for the class names.- Returns:
true
if modified,false
for no change.- Throws:
IllegalArgumentException
- If one of the class names are invalid.
setEnabled
public final boolean setEnabled(boolean on) Sets the enabled state of the component.- Specified by:
setEnabled
in interfaceIComponent
- Parameters:
on
- The enabled state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setEnabled
Sets the enabled state of the component.- Parameters:
on
- The enabled state.trigger
- The trigger VS component, null for none.- Returns:
- true when this property has been changed, false otherwise (or for error).
isEnabled
public final boolean isEnabled()Get the enabled state of the component.- Specified by:
isEnabled
in interfaceIComponent
- Returns:
- true if component is enabled, false otherwise.
setReadOnly
public final boolean setReadOnly(boolean on) Sets the read-only state of the component.Note: certain components are always in a "kind of read-only" mode, thus this property doesn't really apply to them.
- Specified by:
setReadOnly
in interfaceIComponent
- Parameters:
on
- the read-only state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setReadOnly
Sets the read-only state of the component.Note: certain components are always in a "kind of read-only" mode, thus this property doesn't really apply to them.
- Parameters:
on
- The read-only state.trigger
- The trigger VS component, null for none.- Returns:
- true when this property has been changed, false otherwise (or for error).
isReadOnly
public final boolean isReadOnly()Get the read-only state of the component.Note: certain components are always in a "kind of read-only" mode, thus this property doesn't really apply to them.
- Specified by:
isReadOnly
in interfaceIComponent
- Returns:
- true if component is read-only, false otherwise.
setVisible
public final boolean setVisible(boolean on) Sets the visibility state of the component.- Specified by:
setVisible
in interfaceIComponent
- Parameters:
on
- the visibility state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setVisible
Sets the visibility state of the component.- Parameters:
on
- The visibility state.trigger
- The trigger VS component, null for none.- Returns:
- true when this property has been changed, false otherwise (or for error).
isVisible
public final boolean isVisible()Get the visibility state of the component.- Specified by:
isVisible
in interfaceIComponent
- Returns:
- true if component is visible, false otherwise.
getLayout
Gets the layout properties of this component. If the properties are not present, they are created.setLayoutMgr
Sets the layout manager for the component. If the same layout manager is set twice, there will be no change and the return value is the instance of thelayoutManager
parameter passed into this method.- Specified by:
setLayoutMgr
in interfaceIComponent
- Parameters:
layoutManager
- the layout manager instance, or null to remove the layout manager.- Returns:
- the previous layout manager instance, or
null
if none was set.
getLayoutMgr
Gets the layout manager for the component.- Specified by:
getLayoutMgr
in interfaceIComponent
- Returns:
- the layout manager instance, or
null
if none is set.
getLayoutMgr
Gets the layout manager for the component.- Specified by:
getLayoutMgr
in interfaceIUIComp
- Parameters:
layoutMgrClass
- The class of the layout manager.- Returns:
- the layout manager instance, or
null
if none is set.
add
Adds a component to the container with a property for the layout manager.- Parameters:
component
- the component to add.- Throws:
PropException
- when the container cannot accept the component with the specific layout property.
getText
Gets the text. The string is retrieved from the Atom.TEXT ($text) property and can be eitherStringProp
orKStringProp
.If it's a
KString
, the plain string is returned. It is recommended to use the more accurate text methodsgetPlainText()
orgetKStringText()
to have better control.- Specified by:
getText
in interfaceIComponent
- Returns:
- The plain text string or null if not supported.
getKStringText
Gets the text from the control as aKString
. This KString can be plain or in HTML depending on the input, butKString
provides methods to get text in different ways.Components implementing KString support implements the
interface.IUIHTMLTextComponent
- Specified by:
getKStringText
in interfaceIComponent
- Returns:
- The
KString
of the text if available, or null if none is present or KString is not supported by the component.
setText
Sets the plain text property without tags processing.If the component is connected to a VirtualSpace Field, that text is set instead of the UI component's text.
- Specified by:
setText
in interfaceIComponent
- Parameters:
text
- The text to set in plain text (no tags and no HTML tags will be processed).- Returns:
- true for change of text, false for no change or not supported.
setText
Sets the HTML text property KStringProp Atom.TEXT ($text).Components implementing KString support implements the
interface.IUIHTMLTextComponent
- Specified by:
setText
in interfaceIComponent
- Parameters:
text
- The text to set.- Returns:
- true for change of text, false for no change or not supported.
setHTMLText
Sets the HTML text property KStringProp without tags processing.The
KStringException
is caught in case of invalid HTML text and logs a warning message.Components implementing KString support implements the
interface.IUIHTMLTextComponent
- Specified by:
setHTMLText
in interfaceIComponent
- Parameters:
text
- The text to set.- Returns:
- true for change of text, false for no change or not supported.
getValue
Gets the value from a property namedname
.getValue
Gets the value from a property namedatom
.getBestVSFieldValueType
Requests the value type that would best suit the listener.- Specified by:
getBestVSFieldValueType
in interfaceIVSFieldListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.- Returns:
- null if none is available.
getVSField
Gets the connected or disconnected VirtualSpace Field.- Specified by:
getVSField
in interfaceIUIComp
- Returns:
- The field, or null if no field resolved (connected or disconnected) is present.
isVSFieldDisconnected
public boolean isVSFieldDisconnected()Checks if the connection state to the VirtualSpace Field is disconnected.- Specified by:
isVSFieldDisconnected
in interfaceIUIComp
- Returns:
- true if currently disconnected.
disconnectVSField
public boolean disconnectVSField()Disconnects from the VirtualSpace Field connection.- Specified by:
disconnectVSField
in interfaceIUIComp
- Returns:
- true for success, false if already done or none is connected.
reconnectVSField
public boolean reconnectVSField(boolean update) Reconnects to a previously disconnected VirtualSpace Field connection.The method
setVSFieldToComponent(VSField)
is called if there was a disconnected field set.- Specified by:
reconnectVSField
in interfaceIUIComp
- Parameters:
update
- Update flag, i.e. if all states, messages and field contents should be updated to match the field.- Returns:
- true for success, false if not disconnected.
onResolved
Called when the property reference has been resolved. UI components use this method to set its state according to the field, this is handled in by theUIComp
class.Components must override to provide the implementation for e.g. value contents, styles, etc.
- Specified by:
onResolved
in interfaceIVSFieldListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.field
- The target reference.
getMappedVSComponent
Gets the main component that is used to map the UI component to the VirtualSpace.- Returns:
- The VS component, or null for none. Default is to return the VSField of UIComp. Override e.g. for actions.
getComponentMappings
Gets the mappings to VSComponent's for this component.The VS components are sorted for the deepest first.
- Specified by:
getComponentMappings
in interfaceIUIComp
- Returns:
- An unmodifiable set of VSComponent's, or null for no VS mappings.
getVSStateFocus
Gets the VS component for state and focus of this component (always null) if the component is not a container.- Returns:
- The component is always null for a non-container UI component.
getFirstContainerVSStateFocus
Gets the first VS component encountered for state and focus of this container or in the parent tree up to the panel level.- Returns:
- The component (generally a VS Group), null if none is set.
addMappings
Gets the mappings of a VirtualSpace to the panel components.The default is to find the relative references to VS and add those references. Override to provide other functionality.
- Parameters:
mappings
- The mappings instance to fill in.vsStateFocus
- Do not go past this component when going up in the parent tree, null for none.
setVSFieldToComponent
Method called when a VirtualSpace Field is resolved or when reconnection is done. Override to provide additional processing. By default all states (enabled, read-only and visible), message and field contents are set from the field to the component.- Specified by:
setVSFieldToComponent
in interfaceIUIComp
- Parameters:
field
- The VS field.
setVSFieldMessageToComponent
Sets the VirtualSpace Field's message to this component.- Specified by:
setVSFieldMessageToComponent
in interfaceIUIComp
- Parameters:
field
- The VS field.clear
- Flag to clear the component message if the field hasn't got a message.- Returns:
- true if changed, false for no change.
onBroken
Called when the property reference has been broken, i.e. unresolved.- Specified by:
onBroken
in interfaceIVSFieldListener
- Parameters:
reference
- The VSRelativeReference instance holding the reference.field
- The target reference.
onStateChanged
Called when the field changes state.- Specified by:
onStateChanged
in interfaceIVSFieldListener
- Parameters:
field
- The VS field.state
- The state change.on
- New state.
onParentStateChanged
Called when the column changes state.- Specified by:
onParentStateChanged
in interfaceIVSComponentListener
- Parameters:
parent
- The parent who's state was changed.state
- The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.on
- New state.
onValueChanged
public void onValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing) Called when the field value is set.Components must override to provide the implementation when they are not implementing IPlainTextComponent, in this case the default implementation transports the field string value to this text components plain text.
- Specified by:
onValueChanged
in interfaceIVSFieldListener
- Parameters:
field
- The VS field.value
- The value, never null, butvalue.isNull()
could be true.trigger
- The trigger property that may be null.postProcessing
- Post-processing instance.
enterVSProcessing
Call this method when the VSField or the text will update each other, in order to avoid recursion in event processing.Programming note: it is IMPERATIVE that the
exitVSProcessing()
is called after any kind of call to this routine: surround e.g. with "try-finally" block. If this method returnsfalse
theexitVSProcessing()
should not be called.- Parameters:
component
- The VS component that is used for processing.- Returns:
- true if OK to process, false otherwise.
exitVSProcessing
public final void exitVSProcessing()Call this routine to exit VSField processing routine that was entered usingenterVSProcessing(VSComponent)
.- Throws:
InternalError
- If theenterVSProcessing(VSComponent)
wasn't called.
doUpdateVSFieldFromUIComponent
protected boolean doUpdateVSFieldFromUIComponent()Method to check if updates of this component's text and attributes should update the VS field.- Returns:
- true always. Override to stop processing of VS field.
onEventSelf
Updates a VirtualSpace Field when a component text changes.- Specified by:
onEventSelf
in interfaceIGProp<GProp<?>[]>
- Overrides:
onEventSelf
in classGProp<GProp<?>[]>
- Parameters:
event
- The property event.
getTrigger
Gets the trigger from an event. If the event is remote induced, it is set to "this" component. Otherwise the value is the event's trigger.- Parameters:
event
- The event, null for none.- Returns:
- The trigger, never null (defaults to "this").
hasSelectionChanged
protected boolean hasSelectionChanged()Checks if the selection has changed since last call to fireSelection.- Returns:
- true for changed, false for no changes (or component is not a selection component).
fireSelection
public boolean fireSelection()Fires the selection to the listeners if it is changed. The method does not return until it has notifiedthis.onNotifySelectionChanged()
method, listeners, and the UI component's onUISelection method.- Returns:
- true if selection really has changed, false otherwise (or the component is not an instance of IUISelectionComp).
fireSelection
Fires the selection to the listeners if it is changed.- Parameters:
event
- The trigger of the event, MUST be non-null.- Returns:
- true if selection really has changed, false otherwise (or the component is not an instance of IUISelectionComp).
processVSComponentSelection
Override to process the VS components selection state when Atom.SELECTED BoolProp changes. Nothing is done by default and must be overridden to process selections by each component.Typically, call
mappedComponent.setSelected(isSelected(),this);
- Parameters:
mappedComponent
- The matching mapped component.
onSelectionChanged
Method called when the selection of the component changed due to a property change (value changed, property added or removed). Note that this method is allowed to perform actions that changes selection, e.g. if an update to VS failed and the selection is restored or set elsewhere.Override the
onNotifySelectionChanged()
method if you wish to know that the selection really has changed.- Parameters:
event
- The event that causes the selection change.
onNotifySelectionChanged
Method called when the selection of the component has changed and has been verified to be different from a previous selection. Subclasses can override this method to inform potential listeners.- Parameters:
event
- The event that causes the selection change, COULD BE NULL!
setComponentToVSField
public int setComponentToVSField()Sets the text or value from this text or value component to its VirtualSpace Field, if any.- Specified by:
setComponentToVSField
in interfaceIUIComp
- Returns:
- 1 for update completed, 0 for nothing done and -1 for error occurred.
getErrorMessage
Gets the localized error message for a validation exception.- Specified by:
getErrorMessage
in interfaceIUIComp
- Parameters:
exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
getErrorMessage
Gets the localized error message for a validation exception.- Specified by:
getErrorMessage
in interfaceIUIComp
- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
to look it up for the current session.exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
getErrorMessageString
Gets the localized error message for a validation exception.- Parameters:
exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
getErrorMessageString
Gets the localized error message for a validation exception.- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
to look it up for the current session.exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
getErrorMessageEx
Gets the localized error message for a validation exception of any kind of exception.- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
to look it up for the current session.exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
getErrorMessageStringEx
Gets the localized error message for a validation exception of any kind of exception.- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
to look it up for the current session.exception
- The exception, ornull
for no error.- Returns:
- The error message, e.g. to display in the component, or
null
for no error present, i.e. theexception
isnull
.
setErrorMessage
Transposes an exception from conversion to the component as an error message.- Specified by:
setErrorMessage
in interfaceIUIComp
- Parameters:
exception
- The exception, ornull
to remove it.
setErrorMessage
Transposes an exception from conversion to the component as an error message.- Specified by:
setErrorMessage
in interfaceIUIComp
- Parameters:
localeString
- ThelocaleString
instance to used for localization, ornull
to look it up for the current session.exception
- The exception, ornull
to remove it.
onComponentSelectedInParent
public void onComponentSelectedInParent(boolean on) Called by the parent container to inform that this component has been selected in its container. The containers that call this method are typically accordion, swap and tab containers.The container processes this method by selecting the VSComponent for state and focus that may be connected.
- Parameters:
on
- The selection state.
setTooltip
Sets (or removes) the tooltip for the component.- Specified by:
setTooltip
in interfaceIComponent
- Parameters:
tooltip
- The tooltip, ornull
to remove it.- Returns:
- true for changed, false for no change.
setTooltip
Sets (or removes) the plain tooltip text for the component.- Specified by:
setTooltip
in interfaceIComponent
- Parameters:
text
- The plain tooltip text, ornull
to remove it.- Returns:
- true for changed, false for no change.
getTooltip
Gets the current tooltip for the component.- Specified by:
getTooltip
in interfaceIComponent
- Returns:
- The tooltip, or
null
for none.
getTooltipText
Gets the current tooltip text for the component as a plain string.- Specified by:
getTooltipText
in interfaceIComponent
- Returns:
- The tooltip as a plain string, or
null
for none.
setErrorMessage
Sets (or removes) the ERROR message for the component.- Specified by:
setErrorMessage
in interfaceIComponent
- Parameters:
errorMessage
- The ERROR message, ornull
to remove it.- Returns:
- true for changed, false for no change.
setErrorMessage
Sets (or removes) the ERROR message for the component.- Specified by:
setErrorMessage
in interfaceIComponent
- Parameters:
errorMessage
- The ERROR message, ornull
to remove it.- Returns:
- true for changed, false for no change.
clearErrorMessage
public boolean clearErrorMessage()Clears the error message, if any.- Specified by:
clearErrorMessage
in interfaceIComponent
- Returns:
- true if changed, false otherwise.
setMessage
Sets (or removes) the message for the component.- Specified by:
setMessage
in interfaceIComponent
- Parameters:
message
- The message, ornull
to remove it.- Returns:
- true for changed, false for no change.
setMessage
Sets (or removes) a plain message string for the component with specified category.- Specified by:
setMessage
in interfaceIComponent
- Parameters:
message
- The message to set, ornull
to clear it.category
- The category of the message:IUIComp.NONE
,IUIComp.INFORMATION
,IUIComp.WARNING
orIUIComp.ERROR
.- Returns:
- true for changed, false for no change.
getMessage
Gets the current message for the component.- Specified by:
getMessage
in interfaceIComponent
- Returns:
- The message, or
null
for none.
getMessageText
Gets the current message text for the component as a plain string.- Specified by:
getMessageText
in interfaceIComponent
- Returns:
- The message as a plain string, or
null
for none.
setBadge
Sets a red badge text with default font size for the component as a plain string.- Specified by:
setBadge
in interfaceIComponent
- Parameters:
text
- The plain text string, or null to clear it.- Returns:
- true for changed, false for no change.
setBadge
Sets or clears the badge of the component.- Specified by:
setBadge
in interfaceIComponent
- Parameters:
badge
- The badge to set, or null to clear it.- Returns:
- true for changed, false for no change.
getBadge
Gets the badge for the component.- Specified by:
getBadge
in interfaceIComponent
- Returns:
- The badge, or null if undefined.
isRTL
public boolean isRTL()Returns if the component is displayed in RTL or not.canAcceptUIContainerFocus
Returns if this container can accept focus itself or for one of its children components. If this is a component and not a container, this request is redirected to the parent container.This method recurses up to the topmost UI container, and all containers must return null for this method to return null.
Typically, a container returns itself as instance if it is disabled or hidden.
- Specified by:
canAcceptUIContainerFocus
in interfaceIUIComp
- Returns:
- null if this container (or parent container if this is a component) and all containers up to the topmost level returns null, otherwise an error message why the container that did not accept focus.
setUIContainerFocus
Sets the focus to the UI container and all its parents. This method is called when focus is to be set to a component, making it possible for containers such as accordion/swap/tab to change its main container into view.Subclasses must override this method to process it, but make sure to call
super.setUIContainerFocus(requestor)
first!- Specified by:
setUIContainerFocus
in interfaceIUIComp
- Parameters:
requestor
- The requestor is a child to this container.doAnimate
- Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.- Returns:
- null for success, otherwise an error message why it failed.
canRequestFocus
Returns if this component can receive focus. Focus capable components may override to returnnull
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, "Component is hidden" ifisVisible()
isfalse
or "Component is disabled" ifisEnabled()
isfalse
.- Specified by:
canRequestFocus
in interfaceIPropCnr
- Returns:
null
focus is possible to this component, or an error message describing why focus cannot be requested.
canRequestFocus
Returns if this component can receive focus. Focus capable components may override to returnnull
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, "Component is hidden" ifisVisible()
isfalse
or "Component is disabled" ifisEnabled()
isfalse
.- Specified by:
canRequestFocus
in interfaceIPropCnr
- Overrides:
canRequestFocus
in classPropCnr
- Parameters:
ignoreVisibleFlag
- Flag indicating that the visible state should be ignored. If this flag is false and the component hidden an error message is returned.ignoreEnabledFlag
- Flag indicating that the enabled state should be ignored. If this flag is false and the component hidden an error message is returned.- Returns:
null
focus is possible to this component, or an error message describing why focus cannot be requested.
couldRequestFocusIfVirtualized
Returns if this component could receive focus if it would be virtualized. Focus capable components may override to returnnull
for success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusComp
interface, "Component is hidden" ifisVisible()
isfalse
and theignoreVisibleFlag
isfalse
, or "Component is disabled" ifisEnabled()
isfalse
theignoreEnabledFlag
isfalse
.- Specified by:
couldRequestFocusIfVirtualized
in interfaceIPropCnr
- Overrides:
couldRequestFocusIfVirtualized
in classPropCnr
- Parameters:
ignoreVisibleFlag
- Flag indicating that the visible state should be ignored. If this flag is false and the component hidden an error message is returned.ignoreEnabledFlag
- Flag indicating that the enabled state should be ignored. If this flag is false and the component hidden an error message is returned.- Returns:
null
focus is possible to this component, or an error message describing why focus cannot be requested.
hasFocus
public boolean hasFocus()Returns if the component currently has focus.requestFocus
Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.This method is less precise than
requestFocusEx()
, but avoids try-catching.- Specified by:
requestFocus
in interfaceIComponent
- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.- Specified by:
requestFocusEx
in interfaceIComponent
- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
requestFocus
Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.This method is less precise than
requestFocusEx()
, but avoids try-catching.- Specified by:
requestFocus
in interfaceIComponent
- Parameters:
doAnimate
- Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
Requests focus to this component. This call is redirected to the panel focus engine. The engine may veto the focus change, because it currently cannot change focus, or the request is not virtualized.- Specified by:
requestFocusEx
in interfaceIComponent
- Parameters:
doAnimate
- Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
requestFocus
Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is less precise than
PropCnr.requestFocusEx(IGProp, boolean, IFocusVetoListener)
, but avoids try-catching.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will return "Component not focusable" if called on a non-focus component.- Specified by:
requestFocus
in interfaceIPropCnr
- Overrides:
requestFocus
in classPropCnr
- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will throwFocusException
with message "Component not focusable" if called on a non-focus component.- Specified by:
requestFocusEx
in interfaceIPropCnr
- Overrides:
requestFocusEx
in classPropCnr
- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
requestFocus
Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is less precise than
PropCnr.requestFocusEx(IGProp, boolean, IFocusVetoListener)
, but avoids try-catching.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will return "Component not focusable" if called on a non-focus component.- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
null
for success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
public boolean requestFocusEx(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate) throws FocusException Requests focus to this component. This call is redirected to the focus engine for the component type. The engine may veto the focus change, because it currently cannot change focus, or the request is not or cannot be virtualized.This method is implemented in
PropCnr
, but should only be called forIFocusComp
implementing property classes. This method will throwFocusException
with message "Component not focusable" if called on a non-focus component.- Parameters:
trigger
- The trigger property, null for none.isRemoteInduced
- Flag for remote induced focus.- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException
- If focus could not be changed.
onFocusGained
Called to the component when it receives focus. This method will become visible when the interface is added to a component extending UIComp, but it will not be required to provide the code unless specific code is required.Focus components override this method if they need to process focus lost.
- Parameters:
opposite
- Component losing focus, null for none.trigger
- The component triggering the focus, null for none.isRemoteInduced
- Flag indicating this event is due to a remote event.
onRemoteEvent
Called when a remote property event should be processed by this property.A subclass can override this method to perform appropriate processing and is not required to call
super.onRemoteEvent(e)
.The onRemoteEvent is NOT called when in a proxied property container, but rather the normal onEventSelf method.
The UIComp implementation processes remote induced focus events.
- Specified by:
onRemoteEvent
in interfaceIGProp<GProp<?>[]>
- Overrides:
onRemoteEvent
in classGProp<GProp<?>[]>
- Parameters:
event
- The remote event.
verify
Verifies this property container: component type must match panel type (desktop v/s mobile).verifyComponentScope
protected boolean verifyComponentScope(UIContainer scopeContainer, String what, PropVerification verification, VSComponent vsOuter) Verifies that this component has it's VS references inside the outer VS reference.- Parameters:
scopeContainer
- The scope container.what
- What the scope container is.verification
- The property verification class.vsOuter
- The outer VS parent.- Returns:
- true if OK, false if somehow outside.
onPrepare
protected void onPrepare(IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, List<Throwable> errors) throws PropException Called when the application is being prepared. The order ofonPrepare
calls is always parent first, the children. The method is called twice, first time withisPostCall
set tofalse
, then a second time withtrue
.- Overrides:
onPrepare
in classGProp<GProp<?>[]>
- Parameters:
appOwner
- The application owner.moduleOwner
- The Module owner.isPostCall
- Flag indicating this is a post-call.errors
- A list of errors that occurred but did not cause an abort.- Throws:
PropException
- For property errors during the application preparation to need to abort.
onPrepare
Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.Components should override this method to load it's required methods.
- Parameters:
cr
- The class reference with a valid reference.errors
- The list of errors that is returned to the caller in case resolving fails.
invokeOnUICreateTree
Invokes the onUICreate method for the component if a panel is present. This method should only be invoked when a component is resolved during the post-resolve virtualization process, or when a component is added into an already virtualized UI component tree.The onUICreate method is called first for the parents, then its children recursively.
- Parameters:
panel
- The panel in which the component is a child of (or the panel itself).- Throws:
NullPointerException
- If thepanel
isnull
.
onPropDispose
protected void onPropDispose()Called when a property is disposed of by delete/remove in a container, or by the dispose method.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.- Overrides:
onPropDispose
in classPropCnr
getTitle
Get the title of the component (i.e. tooltip for mouse hover typically).- Returns:
- The component title, or null for none.
- See Also:
getTitleKS
Gets the title of the component as a (Plain) KString (i.e. tooltip for mouse hover typically).Note: most components uses PlainKString's but e.g. UIChart supports KString with HTML.
- Returns:
- The component title, or null for none.
- See Also:
getTitlePKS
Gets the title of the component as a PlainKString (i.e. tooltip for mouse hover typically).- Returns:
- The component title, or null for none.
- See Also:
createTitleProp
Creates the title property a StringProp, KStringProp or PlainKStringProp depending on the component.- Returns:
- A new PlainKStringProp named Atom.TITLE by default, override for other types.
setTitle
Get the title of the component (i.e. tooltip for mouse hover typically). Sets the component title.- Parameters:
str
- The title.- Returns:
- true for value changed, false for no change.
setTitle
Get the title of the component (i.e. tooltip for mouse hover typically). Sets the component title.Note: only a few components like UIChart supports KString's with HTML, so this method might fail if you attempt to set a KString with HTML type on e.g. a UILabel.
- Parameters:
str
- The KString title.- Returns:
- true for value changed, false for no change.
setTitle
Get the title of the component (i.e. tooltip for mouse hover typically). Sets the component title.- Parameters:
str
- The plain KString title.- Returns:
- true for value changed, false for no change.