Class UIComp
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.ui.UIComp
- All Implemented Interfaces:
EventListener,IMessageBox,IComponent,ICustomDataProvider,IGProp<GProp<?>[]>,IPropCnr,IUIComp,IVSComponentListener,IVSComponentState,IVSFieldListener,java.lang.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
public abstract class UIComp extends PropCnr implements IUIComp
The UIComp class is the basic implementation of a single user interface component.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
Fields Modifier and Type Field Description static UIComp[]EMPTYEmpty array of components.protected static intREMOTE_FOCUS_EVENTRemote event for focus.protected StylesstylesThe style container.protected VSFieldvsFieldThe 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_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
Constructors Constructor Description UIComp()Creates a property container with the specified name with a null value.UIComp(Atom propertyAtom)Creates a property container with the specified name with a null value.UIComp(Atom propertyAtom, GProp<?>[] properties)Creates a property container with the specified name and properties.
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(UIComp component)Adds a component to the container with a property for the layout manager.protected voidaddMappings(VSMappings mappings, VSComponent vsStateFocus)Gets the mappings of a VirtualSpace to the panel components.static voidassignFontInfoResolver(IFontInfo.Resolver resolver)Assigns the IFontInfo resolver.java.lang.StringcanAcceptUIContainerFocus()Returns if this container can accept focus itself or for one of its children components.booleancanAlignX()Returns if the component can be aligned left, right, center, or horizontal fill.booleancanAlignY()Returns if the component can be aligned top, bottom, middle or vertical fill.booleancanFillX()Returns if the component can fill in X or not.booleancanFillY()Returns if the component can fill in Y or not.java.lang.StringcanRequestFocus()Returns if this component can receive focus.java.lang.StringcanRequestFocus(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag)Returns if this component can receive focus.booleanclearErrorMessage()Clears the error message, if any.UICompclone()Creates a clone out of this property.java.lang.StringcouldRequestFocusIfVirtualized(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag)Returns if this component could receive focus if it would be virtualized.protected StylescreateStyles()Creates the Styles container (can be overridden by Designer to create com.iizigo.style.prop.EditorStyles).protected GProp<?>createTitleProp()Creates the title property a StringProp, KStringProp or PlainKStringProp depending on the component.booleandisconnectVSField()Disconnects from the VirtualSpace Field connection.booleanenterVSProcessing(VSComponent component)Call this method when the VSField or the text will update each other, in order to avoid recursion in event processing.voidexitVSProcessing()Call this routine to exit VSField processing routine that was entered usingenterVSProcessing(VSComponent).booleanfireSelection()Fires the selection to the listeners if it is changed.protected booleanfireSelection(GEvent event)Fires the selection to the listeners if it is changed.java.util.Map<java.lang.String,java.lang.Object>forbiddenGetCustomDataMap(boolean doCreate)Deprecated.abstract SizegetApproximateSize()Returns the size of the component in pixels.GBadgegetBadge()Gets the badge for the component.Value.TypegetBestVSFieldValueType(VSRelativeReference<?> reference)Requests the value type that would best suit the listener.intgetComponentID()Creates or gets the unique ID within the panel for a component.java.util.List<VSComponent>getComponentMappings()Gets the mappings to VSComponent's for this component.KStringgetErrorMessage(ValueConversionException exception)Gets the localized error message for a validation exception.KStringgetErrorMessage(ILocaleString localeString, ValueConversionException exception)Gets the localized error message for a validation exception.KStringgetErrorMessageEx(ILocaleString localeString, java.lang.Exception exception)Gets the localized error message for a validation exception of any kind of exception.java.lang.StringgetErrorMessageString(ValueConversionException exception)Gets the localized error message for a validation exception.java.lang.StringgetErrorMessageString(ILocaleString localeString, ValueConversionException exception)Gets the localized error message for a validation exception.java.lang.StringgetErrorMessageStringEx(ILocaleString localeString, java.lang.Exception exception)Gets the localized error message for a validation exception of any kind of exception.VSComponentgetFirstContainerVSStateFocus()Gets the first VS component encountered for state and focus of this container or in the parent tree up to the panel level.intgetFixHeight()Gets the designed fixed height of this component in pixels.intgetFixWidth()Gets the designed fixed width of this component in pixels.IFontInfogetFontInfo()Returns the font information from this component.intgetForcedAlignX()Gets the default alignment in X when it is not supported, i.e.intgetForcedAlignY()Gets the default alignment in Y when it is not supported, i.e.KStringgetKStringText()Gets the text from the control as aKString.LayoutPropgetLayout()Gets the layout properties of this component.LayoutMgr<?>getLayoutMgr()Gets the layout manager for the component.<LAYOUT_MGR extends LayoutMgr<?>>
LAYOUT_MGRgetLayoutMgr(java.lang.Class<LAYOUT_MGR> layoutMgrClass)Gets the layout manager for the component.VSComponentgetMappedVSComponent()Gets the main component that is used to map the UI component to the VirtualSpace.KTooltipgetMessage()Gets the current message for the component.java.lang.StringgetMessageText()Gets the current message text for the component as a plain string.intgetPixelHeight()Returns the height in pixel units of the component from the layout.intgetPixelWidth()Returns the width in pixel units of the component from the layout.voidgetPredefinedProps()Gets the references to predefined properties.SizegetSize()Returns the size of the component in pixels.StylesgetStyles()Gets the Styles property.StylesgetStyles(boolean doCreate)Gets the Styles property.java.lang.StringgetText()Gets the text.java.lang.StringgetTitle()Get the title of the component (i.e.KStringgetTitleKS()Gets the title of the component as a (Plain) KString (i.e.PlainKStringgetTitlePKS()Gets the title of the component as a PlainKString (i.e.KTooltipgetTooltip()Gets the current tooltip for the component.java.lang.StringgetTooltipText()Gets the current tooltip text for the component as a plain string.protected GProp<?>getTrigger(GEvent event)Gets the trigger from an event.UIPanelBasegetUIPanel()Gets the UIPanel.UIContainergetUIParent()Gets the parent container of this component.ValuegetValue(Atom atom)Gets the value from a property namedatom.ValuegetValue(java.lang.String name)Gets the value from a property namedname.VirtualSpacegetVirtualSpace()Gets the VirtualSpace of the UI component.VSFieldgetVSField()Gets the connected or disconnected VirtualSpace Field.VSComponentgetVSStateFocus()Gets the VS component for state and focus of this component (always null) if the component is not a container.booleanhasExplicitHeight()Verifies if the component has an implicit height.booleanhasExplicitWidth()Verifies if the component has a width.booleanhasFocus()Returns if the component currently has focus.booleanhasImplicitAlignFillX()Returns if the component has implicit component horizontal fill.booleanhasImplicitAlignFillY()Returns if the component has implicit component vertical fill.booleanhasImplicitHeight()Verifies if the component has an implicit height.booleanhasImplicitWidth()Verifies if the component has a width.protected booleanhasSelectionChanged()Checks if the selection has changed since last call to fireSelection.booleanisEnabled()Get the enabled state of the component.booleanisMobile()Checks if the panel is of mobile type.booleanisReadOnly()Get the read-only state of the component.booleanisRTL()Returns if the component is displayed in RTL or not.booleanisVisible()Get the visibility state of the component.booleanisVSFieldDisconnected()Checks if the connection state to the VirtualSpace Field is disconnected.booleanmustHaveExplicitHeight()Does this component require an explicitly defined height?booleanmustHaveExplicitWidth()Does this component require an explicitly defined width?booleanmustHaveHeight()Does this component require a height?booleanmustHaveWidth()Does this component require a width?voidonBroken(VSRelativeReference<?> reference, VSField field)Called when the property reference has been broken, i.e.voidonComponentSelectedInParent(boolean on)Called by the parent container to inform that this component has been selected in its container.voidonEventSelf(GEvent event)Updates a VirtualSpace Field when a component text changes.voidonFocusGained(IFocusComp opposite, IGProp<?> trigger, boolean isRemoteInduced)Called to the component when it receives focus.protected voidonNotifySelectionChanged(GEvent event)Method called when the selection of the component has changed and has been verified to be different from a previous selection.voidonParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)Called when the column changes state.protected voidonPrepare(ClassReference cr, java.util.List<java.lang.Throwable> errors)Called to resolve methods for the component from main "onPrepare" once the ClassReference has been found.protected voidonPrepare(IAppOwner appOwner, IModuleOwner moduleOwner, boolean isPostCall, java.util.List<java.lang.Throwable> errors)Called when the application is being prepared.protected voidonPropDispose()Called when a property is disposed of by delete/remove in a container, or by the dispose method.voidonRemoteEvent(RemoteEvent event)Called when a remote property event should be processed by this property.voidonResolved(VSRelativeReference<?> reference, VSField field)Called when the property reference has been resolved.protected voidonSelectionChanged(GEvent event)Method called when the selection of the component changed due to a property change (value changed, property added or removed).voidonStateChanged(VSField field, IVSComponentState.State state, boolean on)Called when the field changes state.voidonValueChanged(VSField field, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)Called when the field value is set.protected voidonVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp, boolean isPostResolve)Called when virtualization completed.protected voidprocessVSComponentSelection(VSComponent mappedComponent)Override to process the VS components selection state when Atom.SELECTED BoolProp changes.booleanreconnectVSField(boolean update)Reconnects to a previously disconnected VirtualSpace Field connection.java.lang.StringrequestFocus()Requests focus to this component.java.lang.StringrequestFocus(boolean doAnimate)Requests focus to this component.java.lang.StringrequestFocus(IGProp<?> trigger, boolean isRemoteInduced)Requests focus to this component.java.lang.StringrequestFocus(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate)Requests focus to this component.booleanrequestFocusEx()Requests focus to this component.booleanrequestFocusEx(boolean doAnimate)Requests focus to this component.booleanrequestFocusEx(IGProp<?> trigger, boolean isRemoteInduced)Requests focus to this component.booleanrequestFocusEx(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate)Requests focus to this component.voidresetComponentID()Resets the component ID, typically when copied or saved in order to add make copies of the (some) component data.booleansetBadge(GBadge badge)Sets or clears the badge of the component.booleansetBadge(java.lang.String text)Sets a red badge text with default font size for the component as a plain string.intsetComponentToVSField()Sets the text or value from this text or value component to its VirtualSpace Field, if any.booleansetEnabled(boolean on)Sets the enabled state of the component.booleansetEnabled(boolean on, IVSComponent trigger)Sets the enabled state of the component.voidsetErrorMessage(ValueConversionException exception)Transposes an exception from conversion to the component as an error message.voidsetErrorMessage(ILocaleString localeString, ValueConversionException exception)Transposes an exception from conversion to the component as an error message.booleansetErrorMessage(KString errorMessage)Sets (or removes) the ERROR message for the component.booleansetErrorMessage(java.lang.String errorMessage)Sets (or removes) the ERROR message for the component.booleansetHTMLText(java.lang.String text)Sets the HTML text property KStringProp without tags processing.LayoutMgr<?>setLayoutMgr(LayoutMgr<?> layoutManager)Sets the layout manager for the component.booleansetMessage(KTooltip message)Sets (or removes) the message for the component.booleansetMessage(java.lang.String message, int category)Sets (or removes) a plain message string for the component with specified category.booleansetReadOnly(boolean on)Sets the read-only state of the component.booleansetReadOnly(boolean on, IVSComponent trigger)Sets the read-only state of the component.booleansetText(KString text)Sets the HTML text property KStringProp Atom.TEXT ($text).booleansetText(java.lang.String text)Sets the plain text property without tags processing.booleansetTitle(KString str)Get the title of the component (i.e.booleansetTitle(PlainKString str)Get the title of the component (i.e.booleansetTitle(java.lang.String str)Get the title of the component (i.e.booleansetTooltip(KTooltip tooltip)Sets (or removes) the tooltip for the component.booleansetTooltip(java.lang.String text)Sets (or removes) the plain tooltip text for the component.java.lang.StringsetUIContainerFocus(UIComp requestor, boolean doAnimate)Sets the focus to the UI container and all its parents.booleansetVisible(boolean on)Sets the visibility state of the component.booleansetVisible(boolean on, IVSComponent trigger)Sets the visibility state of the component.booleansetVSFieldMessageToComponent(VSField field, boolean clear)Sets the VirtualSpace Field's message to this component.voidsetVSFieldToComponent(VSField field)Method called when a VirtualSpace Field is resolved or when reconnection is done.booleanverify(PropVerification verification)Verifies this property container: component type must match panel type (desktop v/s mobile).protected booleanverifyComponentScope(UIContainer scopeContainer, java.lang.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, doVirtualizePropCnr, 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, getReferences, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, isSibling, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, 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, 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, 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, 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, onPropInvalidateCache, onPropParentChanged, onPropValueSet, 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
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, getReferences, getRelativePropName, getRootParent, getTreeLock, getValueClasses, getVSReference, hasChanged, 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, 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, verifyHasPropertyItem, warning, warning, warning
Methods inherited from interface com.iizix.gyro.IMessageBox
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, isSibling, 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 Detail
REMOTE_FOCUS_EVENT
protected static final int REMOTE_FOCUS_EVENT
Remote event for focus.- See Also:
- Constant Field Values
EMPTY
public static final UIComp[] EMPTY
Empty array of components.
styles
protected Styles styles
The style container.
vsField
protected VSField 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 Detail
UIComp
public UIComp()
Creates a property container with the specified name with a null value.
UIComp
public UIComp(Atom propertyAtom)
Creates a property container with the specified name with a null value.- Parameters:
propertyAtom- the property atom.
UIComp
public UIComp(Atom propertyAtom, GProp<?>[] properties) throws PropException
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 Detail
getPredefinedProps
public void getPredefinedProps()
Gets the references to predefined properties. If the Styles is created, make sure to get it.- Overrides:
getPredefinedPropsin classPropCnr
forbiddenGetCustomDataMap
@Deprecated public java.util.Map<java.lang.String,java.lang.Object> forbiddenGetCustomDataMap(boolean doCreate)
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:
forbiddenGetCustomDataMapin interfaceICustomDataProvider- Parameters:
doCreate- Creates the map if required.- Returns:
- The map or newly created map,
nullif 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
public UIComp 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
public final UIContainer getUIParent()
Gets the parent container of this component.- Specified by:
getUIParentin interfaceIComponent- Returns:
- null if none is present.
getUIPanel
public final UIPanelBase getUIPanel()
Gets the UIPanel.- Specified by:
getUIPanelin interfaceIComponent- Returns:
- null if none is present.
getVirtualSpace
public VirtualSpace getVirtualSpace()
Gets the VirtualSpace of the UI component.- Specified by:
getVirtualSpacein interfaceIUIComp- Returns:
- The VirtualSpace, or null for none.
assignFontInfoResolver
public static void assignFontInfoResolver(IFontInfo.Resolver resolver)
Assigns the IFontInfo resolver.
getFontInfo
public IFontInfo 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:
java.lang.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
public Size 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:
java.lang.IllegalStateException- If called outside of the Designer.
getApproximateSize
public abstract Size getApproximateSize() throws java.lang.IllegalStateException
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:
java.lang.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:
getFixWidthin interfaceIUIComp- Returns:
- Zero (default) for not fixed.
getFixHeight
public int getFixHeight()
Gets the designed fixed height of this component in pixels.- Specified by:
getFixHeightin 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:
getComponentIDin 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
public final Styles getStyles()
Gets the Styles property. If it doesn't exist, it is created.- Specified by:
getStylesin interfaceIComponent- Returns:
- The Styles property container or null for none.
getStyles
public final Styles getStyles(boolean doCreate)
Gets the Styles property. If it doesn't exist, it is created depending on thedoCreateflag.- Returns:
- The Styles property container or null for none.
createStyles
protected Styles createStyles()
Creates the Styles container (can be overridden by Designer to create com.iizigo.style.prop.EditorStyles).
setEnabled
public final boolean setEnabled(boolean on)
Sets the enabled state of the component.- Specified by:
setEnabledin interfaceIComponent- Parameters:
on- The enabled state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setEnabled
public final boolean setEnabled(boolean on, IVSComponent trigger)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:
isEnabledin 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:
setReadOnlyin interfaceIComponent- Parameters:
on- the read-only state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setReadOnly
public final boolean setReadOnly(boolean on, IVSComponent trigger)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:
isReadOnlyin 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:
setVisiblein interfaceIComponent- Parameters:
on- the visibility state.- Returns:
- true when this property has been changed, false otherwise (or for error).
setVisible
public final boolean setVisible(boolean on, IVSComponent trigger)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:
isVisiblein interfaceIComponent- Returns:
- true if component is visible, false otherwise.
getLayout
public LayoutProp getLayout()
Gets the layout properties of this component. If the properties are not present, they are created.
setLayoutMgr
public final LayoutMgr<?> setLayoutMgr(LayoutMgr<?> layoutManager)
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 thelayoutManagerparameter passed into this method.- Specified by:
setLayoutMgrin interfaceIComponent- Parameters:
layoutManager- the layout manager instance, or null to remove the layout manager.- Returns:
- the previous layout manager instance, or
nullif none was set.
getLayoutMgr
public LayoutMgr<?> getLayoutMgr()
Gets the layout manager for the component.- Specified by:
getLayoutMgrin interfaceIComponent- Returns:
- the layout manager instance, or
nullif none is set.
getLayoutMgr
public <LAYOUT_MGR extends LayoutMgr<?>> LAYOUT_MGR getLayoutMgr(java.lang.Class<LAYOUT_MGR> layoutMgrClass)
Gets the layout manager for the component.- Specified by:
getLayoutMgrin interfaceIUIComp- Parameters:
layoutMgrClass- The class of the layout manager.- Returns:
- the layout manager instance, or
nullif none is set.
add
public final void add(UIComp component) throws PropException
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
public final java.lang.String getText()
Gets the text. The string is retrieved from the Atom.TEXT ($text) property and can be eitherStringProporKStringProp.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:
getTextin interfaceIComponent- Returns:
- The plain text string or null if not supported.
getKStringText
public KString getKStringText()
Gets the text from the control as aKString. This KString can be plain or in HTML depending on the input, butKStringprovides methods to get text in different ways.Components implementing KString support implements the
interface.IUIHTMLTextComponent- Specified by:
getKStringTextin interfaceIComponent- Returns:
- The
KStringof the text if available, or null if none is present or KString is not supported by the component.
setText
public final boolean setText(java.lang.String text)
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:
setTextin 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
public final boolean setText(KString text)
Sets the HTML text property KStringProp Atom.TEXT ($text).Components implementing KString support implements the
interface.IUIHTMLTextComponent- Specified by:
setTextin interfaceIComponent- Parameters:
text- The text to set.- Returns:
- true for change of text, false for no change or not supported.
setHTMLText
public final boolean setHTMLText(java.lang.String text)
Sets the HTML text property KStringProp without tags processing.The
KStringExceptionis caught in case of invalid HTML text and logs a warning message.Components implementing KString support implements the
interface.IUIHTMLTextComponent- Specified by:
setHTMLTextin interfaceIComponent- Parameters:
text- The text to set.- Returns:
- true for change of text, false for no change or not supported.
getValue
public Value getValue(java.lang.String name)
Gets the value from a property namedname.
getBestVSFieldValueType
public Value.Type getBestVSFieldValueType(VSRelativeReference<?> reference)
Requests the value type that would best suit the listener.- Specified by:
getBestVSFieldValueTypein interfaceIVSFieldListener- Parameters:
reference- The VSRelativeReference instance holding the reference.- Returns:
- null if none is available.
getVSField
public VSField getVSField()
Gets the connected or disconnected VirtualSpace Field.- Specified by:
getVSFieldin 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:
isVSFieldDisconnectedin interfaceIUIComp- Returns:
- true if currently disconnected.
disconnectVSField
public boolean disconnectVSField()
Disconnects from the VirtualSpace Field connection.- Specified by:
disconnectVSFieldin 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:
reconnectVSFieldin 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
public void onResolved(VSRelativeReference<?> reference, VSField field)
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 theUICompclass.Components must override to provide the implementation for e.g. value contents, styles, etc.
- Specified by:
onResolvedin interfaceIVSFieldListener- Parameters:
reference- The VSRelativeReference instance holding the reference.field- The target reference.
getMappedVSComponent
public VSComponent 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
public final java.util.List<VSComponent> getComponentMappings()
Gets the mappings to VSComponent's for this component.The VS components are sorted for the deepest first.
- Specified by:
getComponentMappingsin interfaceIUIComp- Returns:
- An unmodifiable set of VSComponent's, or null for no VS mappings.
getVSStateFocus
public VSComponent 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
public VSComponent 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
protected void addMappings(VSMappings mappings, VSComponent vsStateFocus)
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
public void setVSFieldToComponent(VSField field)
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:
setVSFieldToComponentin interfaceIUIComp- Parameters:
field- The VS field.
setVSFieldMessageToComponent
public boolean setVSFieldMessageToComponent(VSField field, boolean clear)
Sets the VirtualSpace Field's message to this component.- Specified by:
setVSFieldMessageToComponentin 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
public void onBroken(VSRelativeReference<?> reference, VSField field)
Called when the property reference has been broken, i.e. unresolved.- Specified by:
onBrokenin interfaceIVSFieldListener- Parameters:
reference- The VSRelativeReference instance holding the reference.field- The target reference.
onStateChanged
public void onStateChanged(VSField field, IVSComponentState.State state, boolean on)
Called when the field changes state.- Specified by:
onStateChangedin interfaceIVSFieldListener- Parameters:
field- The VS field.state- The state change.on- New state.
onParentStateChanged
public void onParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)
Called when the column changes state.- Specified by:
onParentStateChangedin 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:
onValueChangedin 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
public 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.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 returnsfalsetheexitVSProcessing()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:
java.lang.InternalError- If theenterVSProcessing(VSComponent)wasn't called.
onEventSelf
public void onEventSelf(GEvent event)
Updates a VirtualSpace Field when a component text changes.- Specified by:
onEventSelfin interfaceIGProp<GProp<?>[]>- Overrides:
onEventSelfin classGProp<GProp<?>[]>- Parameters:
event- The property event.
getTrigger
protected GProp<?> getTrigger(GEvent event)
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
protected boolean fireSelection(GEvent event)
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
protected void processVSComponentSelection(VSComponent mappedComponent)
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
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). 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
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. 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:
setComponentToVSFieldin interfaceIUIComp- Returns:
- 1 for update completed, 0 for nothing done and -1 for error occurred.
getErrorMessage
public KString getErrorMessage(ValueConversionException exception)
Gets the localized error message for a validation exception.- Specified by:
getErrorMessagein interfaceIUIComp- Parameters:
exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
getErrorMessage
public KString getErrorMessage(ILocaleString localeString, ValueConversionException exception)
Gets the localized error message for a validation exception.- Specified by:
getErrorMessagein interfaceIUIComp- Parameters:
localeString- ThelocaleStringinstance to used for localization, ornullto look it up for the current session.exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
getErrorMessageString
public java.lang.String getErrorMessageString(ValueConversionException exception)
Gets the localized error message for a validation exception.- Parameters:
exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
getErrorMessageString
public java.lang.String getErrorMessageString(ILocaleString localeString, ValueConversionException exception)
Gets the localized error message for a validation exception.- Parameters:
localeString- ThelocaleStringinstance to used for localization, ornullto look it up for the current session.exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
getErrorMessageEx
public KString getErrorMessageEx(ILocaleString localeString, java.lang.Exception exception)
Gets the localized error message for a validation exception of any kind of exception.- Parameters:
localeString- ThelocaleStringinstance to used for localization, ornullto look it up for the current session.exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
getErrorMessageStringEx
public java.lang.String getErrorMessageStringEx(ILocaleString localeString, java.lang.Exception exception)
Gets the localized error message for a validation exception of any kind of exception.- Parameters:
localeString- ThelocaleStringinstance to used for localization, ornullto look it up for the current session.exception- The exception, ornullfor no error.- Returns:
- The error message, e.g. to display in the component, or
nullfor no error present, i.e. theexceptionisnull.
setErrorMessage
public void setErrorMessage(ValueConversionException exception)
Transposes an exception from conversion to the component as an error message.- Specified by:
setErrorMessagein interfaceIUIComp- Parameters:
exception- The exception, ornullto remove it.
setErrorMessage
public void setErrorMessage(ILocaleString localeString, ValueConversionException exception)
Transposes an exception from conversion to the component as an error message.- Specified by:
setErrorMessagein interfaceIUIComp- Parameters:
localeString- ThelocaleStringinstance to used for localization, ornullto look it up for the current session.exception- The exception, ornullto 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
public boolean setTooltip(KTooltip tooltip)
Sets (or removes) the tooltip for the component.- Specified by:
setTooltipin interfaceIComponent- Parameters:
tooltip- The tooltip, ornullto remove it.- Returns:
- true for changed, false for no change.
setTooltip
public boolean setTooltip(java.lang.String text)
Sets (or removes) the plain tooltip text for the component.- Specified by:
setTooltipin interfaceIComponent- Parameters:
text- The plain tooltip text, ornullto remove it.- Returns:
- true for changed, false for no change.
getTooltip
public KTooltip getTooltip()
Gets the current tooltip for the component.- Specified by:
getTooltipin interfaceIComponent- Returns:
- The tooltip, or
nullfor none.
getTooltipText
public java.lang.String getTooltipText()
Gets the current tooltip text for the component as a plain string.- Specified by:
getTooltipTextin interfaceIComponent- Returns:
- The tooltip as a plain string, or
nullfor none.
setErrorMessage
public boolean setErrorMessage(java.lang.String errorMessage)
Sets (or removes) the ERROR message for the component.- Specified by:
setErrorMessagein interfaceIComponent- Parameters:
errorMessage- The ERROR message, ornullto remove it.- Returns:
- true for changed, false for no change.
setErrorMessage
public boolean setErrorMessage(KString errorMessage)
Sets (or removes) the ERROR message for the component.- Specified by:
setErrorMessagein interfaceIComponent- Parameters:
errorMessage- The ERROR message, ornullto remove it.- Returns:
- true for changed, false for no change.
clearErrorMessage
public boolean clearErrorMessage()
Clears the error message, if any.- Specified by:
clearErrorMessagein interfaceIComponent- Returns:
- true if changed, false otherwise.
setMessage
public boolean setMessage(KTooltip message)
Sets (or removes) the message for the component.- Specified by:
setMessagein interfaceIComponent- Parameters:
message- The message, ornullto remove it.- Returns:
- true for changed, false for no change.
setMessage
public boolean setMessage(java.lang.String message, int category)Sets (or removes) a plain message string for the component with specified category.- Specified by:
setMessagein interfaceIComponent- Parameters:
message- The message to set, ornullto clear it.category- The category of the message:IUIComp.NONE,IUIComp.INFORMATION,IUIComp.WARNINGorIUIComp.ERROR.- Returns:
- true for changed, false for no change.
getMessage
public KTooltip getMessage()
Gets the current message for the component.- Specified by:
getMessagein interfaceIComponent- Returns:
- The message, or
nullfor none.
getMessageText
public java.lang.String getMessageText()
Gets the current message text for the component as a plain string.- Specified by:
getMessageTextin interfaceIComponent- Returns:
- The message as a plain string, or
nullfor none.
setBadge
public boolean setBadge(java.lang.String text)
Sets a red badge text with default font size for the component as a plain string.- Specified by:
setBadgein interfaceIComponent- Parameters:
text- The plain text string, or null to clear it.- Returns:
- true for changed, false for no change.
setBadge
public boolean setBadge(GBadge badge)
Sets or clears the badge of the component.- Specified by:
setBadgein interfaceIComponent- Parameters:
badge- The badge to set, or null to clear it.- Returns:
- true for changed, false for no change.
getBadge
public GBadge getBadge()
Gets the badge for the component.- Specified by:
getBadgein interfaceIComponent- Returns:
- The badge, or null if undefined.
isRTL
public boolean isRTL()
Returns if the component is displayed in RTL or not.
canAcceptUIContainerFocus
public java.lang.String 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:
canAcceptUIContainerFocusin 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
public java.lang.String setUIContainerFocus(UIComp requestor, boolean doAnimate)
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:
setUIContainerFocusin 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
public java.lang.String canRequestFocus()
Returns if this component can receive focus. Focus capable components may override to returnnullfor success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusCompinterface, "Not virtualized" if the component is not in a virtualized state, "Component is hidden" ifisVisible()isfalseor "Component is disabled" ifisEnabled()isfalse.- Specified by:
canRequestFocusin interfaceIPropCnr- Returns:
nullfocus is possible to this component, or an error message describing why focus cannot be requested.
canRequestFocus
public java.lang.String canRequestFocus(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag)Returns if this component can receive focus. Focus capable components may override to returnnullfor success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusCompinterface, "Not virtualized" if the component is not in a virtualized state, "Component is hidden" ifisVisible()isfalseor "Component is disabled" ifisEnabled()isfalse.- Specified by:
canRequestFocusin interfaceIPropCnr- Overrides:
canRequestFocusin 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:
nullfocus is possible to this component, or an error message describing why focus cannot be requested.
couldRequestFocusIfVirtualized
public java.lang.String couldRequestFocusIfVirtualized(boolean ignoreVisibleFlag, boolean ignoreEnabledFlag)Returns if this component could receive focus if it would be virtualized. Focus capable components may override to returnnullfor success, or other error message.Default processing is to return "Component not focusable" if the component doesn't implement the
IFocusCompinterface, "Component is hidden" ifisVisible()isfalseand theignoreVisibleFlagisfalse, or "Component is disabled" ifisEnabled()isfalsetheignoreEnabledFlagisfalse.- Specified by:
couldRequestFocusIfVirtualizedin interfaceIPropCnr- Overrides:
couldRequestFocusIfVirtualizedin 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:
nullfocus 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
public java.lang.String 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:
requestFocusin interfaceIComponent- Returns:
nullfor success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
public boolean requestFocusEx() throws FocusExceptionRequests 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:
requestFocusExin interfaceIComponent- Returns:
- true if focus was changed, false otherwise.
- Throws:
FocusException- If focus could not be changed.
requestFocus
public java.lang.String requestFocus(boolean doAnimate)
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:
requestFocusin interfaceIComponent- Parameters:
doAnimate- Flag to enable animation when selection is changed for e.g. accordion, swap or tab containers.- Returns:
nullfor success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
public boolean requestFocusEx(boolean doAnimate) throws FocusExceptionRequests 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:
requestFocusExin 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
public java.lang.String requestFocus(IGProp<?> trigger, boolean isRemoteInduced)
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 forIFocusCompimplementing property classes. This method will return "Component not focusable" if called on a non-focus component.- Specified by:
requestFocusin interfaceIPropCnr- Overrides:
requestFocusin classPropCnr- Parameters:
trigger- The trigger property, null for none.isRemoteInduced- Flag for remote induced focus.- Returns:
nullfor success, otherwise an error message indicating why focus was not able to be changed.
requestFocusEx
public boolean requestFocusEx(IGProp<?> trigger, boolean isRemoteInduced) 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 forIFocusCompimplementing property classes. This method will throwFocusExceptionwith message "Component not focusable" if called on a non-focus component.- Specified by:
requestFocusExin interfaceIPropCnr- Overrides:
requestFocusExin 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
public java.lang.String requestFocus(IGProp<?> trigger, boolean isRemoteInduced, boolean doAnimate)
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 forIFocusCompimplementing 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:
nullfor 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 forIFocusCompimplementing property classes. This method will throwFocusExceptionwith 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
public void onFocusGained(IFocusComp opposite, IGProp<?> trigger, boolean isRemoteInduced)
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
public void onRemoteEvent(RemoteEvent event)
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:
onRemoteEventin interfaceIGProp<GProp<?>[]>- Overrides:
onRemoteEventin classGProp<GProp<?>[]>- Parameters:
event- The remote event.
verify
public boolean verify(PropVerification verification)
Verifies this property container: component type must match panel type (desktop v/s mobile).
verifyComponentScope
protected boolean verifyComponentScope(UIContainer scopeContainer, java.lang.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, java.util.List<java.lang.Throwable> errors) throws PropException
Called when the application is being prepared. The order ofonPreparecalls is always parent first, the children. The method is called twice, first time withisPostCallset tofalse, then a second time withtrue.- Overrides:
onPreparein 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
protected void onPrepare(ClassReference cr, java.util.List<java.lang.Throwable> errors)
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.
onVirtualizationCompleted
protected void onVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp, boolean isPostResolve)
Called when virtualization completed.This method is called to the entire tree of the newly virtualized property container.
- Overrides:
onVirtualizationCompletedin classGProp<GProp<?>[]>- Parameters:
appGyro- The application gyro instance performing the virtualization.clientGyro- The client gyro session, can benullif not initialized from the client gyro.virtualSpace- The virtualized VirtualSpace.virtualizedProp- The property being virtualized.isPostResolve- Flag indicating this call is done after references are attempted to be resolved.
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:
onPropDisposein classPropCnr
getTitle
public java.lang.String getTitle()
Get the title of the component (i.e. tooltip for mouse hover typically).- Returns:
- The component title, or null for none.
- See Also:
getTitlePKS()
getTitleKS
public KString 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:
getTitle()
getTitlePKS
public PlainKString 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:
getTitle()
createTitleProp
protected GProp<?> 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
public boolean setTitle(java.lang.String str)
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
public boolean setTitle(KString str)
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
public boolean setTitle(PlainKString str)
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.