Class AbstractContentUIContainer<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>>
- java.lang.Object
- com.iizix.prop.GProp<GProp<?>[]>
- com.iizix.prop.PropCnr
- com.iizix.prop.ui.UIComp
- com.iizix.prop.ui.UIContainer
- com.iizix.prop.content.AbstractContentUIContainer<ITEM,ITEM_CONTENT>
- All Implemented Interfaces:
IBackReferenceProvider,EventListener,IFocusComp,IMessageBox,IComponent,ICustomDataProvider,IGProp<GProp<?>[]>,IPropCnr,IUIActionHolder,IUIComp,IUIContainer,IUIContextMenuOwner,IUIFocusComp,IUIIndexedSelectionComp,IUISelectionComp,IUISingleIndexedSelectionComp,IVSColumnBestValueListener,IVSComponentListener,IVSComponentState,IVSFieldListener,IVSGenericComponentListener,IVSTableColumnReferenceOwner,IVSTableListener,java.lang.Cloneable
- Direct Known Subclasses:
MapMarkers,MLGroup
public abstract class AbstractContentUIContainer<ITEM extends IContentItem,ITEM_CONTENT extends IContentData<ITEM>> extends UIContainer implements IVSTableListener, IVSTableColumnReferenceOwner, IVSColumnBestValueListener, IUISingleIndexedSelectionComp, IUIActionHolder
A property container that handles content and has custom content provider support. The container can contain only a specific class of items in a PropCnr. It implements single, multiple selection or has no selection at all.- 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 protected static java.lang.StringPN_SELECTION_TYPEThe property name: selection type "selType".static java.lang.StringTABLE_REF_PROP_NAMEProperty name for VSTableReference.static java.lang.StringUSE_CONTENT_PROVIDER_PROP_NAMEProperty name for the setting of "use content provider" (defaults to "false").Fields inherited from class com.iizix.prop.ui.UIContainer
UICOMP_CLASS, VS_STATE_FOCUS_PROP_NAME
Fields inherited from class com.iizix.prop.ui.UIComp
EMPTY, REMOTE_FOCUS_EVENT, styles, vsField
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, REMOTE_FOCUS_EVENT, WARNING
Fields inherited from interface com.iizix.prop.ui.selection.IUISelectionComp
SELECTION_TYPE_MULTIPLE, SELECTION_TYPE_NONE, SELECTION_TYPE_SINGLE
Constructor Summary
Constructors Constructor Description AbstractContentUIContainer()Creates the content property container.AbstractContentUIContainer(Atom atom)Creates the content property container.
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidadd(int index, ITEM_CONTENT item)Inserts a new item before the specified index.voidadd(ITEM_CONTENT item)Adds a new item to the end of the list.protected voidaddMappings(VSMappings mappings, VSComponent vsStateFocus)Gets the mappings of a VirtualSpace to the panel components.protected voidaddMappingsTable(java.lang.String uiRef, VSMappings mappings, VSComponent vsStateFocus)Gets the VSTable mappings of a VirtualSpace to the panel components.java.lang.StringclearSelection()Clear the selection.AbstractContentUIContainer<ITEM,ITEM_CONTENT>clone()Clones this instance.protected IContentProvider<ITEM,ITEM_CONTENT>createContentProvider()Creates the content provider.protected abstract IContentProvider<ITEM,ITEM_CONTENT>createDefaultContentProvider()Creates and returns a new instance of a default content provider.protected abstract ITEMcreateItem(Atom atom, ITEM_CONTENT data)Creates a new property item from an item data holder and initializes the property.protected java.lang.ObjectequalsTree(PropCnr pc2, int how)Checks for equality in the whole container structure.ITEM_CONTENTget(int index)Gets an item at the specified index.ITEM_CONTENT[]getAll()Gets all items.IContentProviderAPI<ITEM,ITEM_CONTENT>getAPIContentProvider()Gets the content provider for the API.Value.TypegetBestVSColumnHeaderValueType(VSRelativeReference<?> reference)Requests the value type that would best suit the listener.protected abstract Value.Type[]getBestVSColumnHeaderValueTypes()Gets the value type that would best suit the for the columns.protected IContentProvider<ITEM,ITEM_CONTENT>getContentProvider()Gets the or created content provider to use.VSTablegetContentTable()Gets the VS table that is associated with the container to provide the items.protected abstract java.lang.Object[]getContentTableColumnReferenceNames()Gets the atoms of the references that are used to specify the VS column header connections for the VS table.int[]getContentTableColumns()Gets the connected VS table columns in the table.ITEMgetItem(int index)Gets an item at specified index.abstract java.lang.Class<ITEM>getItemClass()Return the class of items stored in the container.abstract java.lang.Class<ITEM_CONTENT>getItemContentClass()Return the class of content items stored in the container.intgetItemCount()Returns the item count.ITEM[]getItems()Gets the container items.java.lang.reflect.MethodgetOnUIActionMethod()Gets the method for the OnUIAction event at runtime.java.lang.reflect.MethodgetOnUISelectionMethod()Returns the method to use for onUISelection notifications that is attached to this selection component.voidgetPredefinedProps()Gets potential references to predefined properties for this container.intgetSelectedIndex()Gets the first selected index.int[]getSelectedIndicies()Gets the selected indicies.IUISelectiongetSelection()Gets the current selection of the component.GenericListener<IUISelectionListener>getSelectionListenerHandler(boolean doCreate)Returns the generic selection listener.AtomgetSelectionPropAtom()Returns the selection property atom for verification of selection changes.intgetSelectionType()Gets the selection type of the component.protected intgetVSColumnIndex(java.lang.Object nameOrAtom)Gets the table column reference property with the String or Atom.VSTablegetVSTable()Gets the VSTable.VSTablegetVSTable(VSTableColumnReference ref)Gets the VSTable for a VSTableColumnReference instance.VSReferenceOwnerData<VSTable,VSTableReference>getVSTableReferenceOwnerData()Gets the table reference owner data for the table column reference.booleanhasDiscreteContentChanges(boolean reset)Flag for contents changes for API when content provider is using discrete components added by the user.intindexOf(ITEM_CONTENT item)Returns the index of an item.java.lang.StringisBackReferenceValid(AnnotationType annotationType, java.lang.String name, boolean isRefOnly)Validates if the back-reference specified is referenced in the first place, i.e.booleanisEmptyContainerAllowed()Returns whether the container should have children in a normal conditions, i.e.booleanisSelected()Returns the selection of state of the component.booleanisUpdatingInCurrentThread(boolean refreshVS)Checks if the current thread is currently in updates mode (with updates from VS).voidonBroken(VSRelativeReference<?> reference, VSTable table)Called when the property reference has been broken, i.e.voidonCellStateChanged(VSField cell, IVSComponentState.State state, boolean on)Called when the cell changes state.voidonCellValueChanged(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)Called when the cell value is set.voidonEventSelf(GEvent event)Event checking to clear cache.protected voidonItemAdded(ITEM item)Item added event.protected voidonItemRemoved(ITEM item)Item removed event.voidonParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)Called when the parent 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 voidonPropDispose()Called when disposed of.protected voidonPropParentChanged(PropCnr oldParent, PropCnr newParent)Called when the parent is changed for this class.voidonResolved(VSRelativeReference<?> reference, VSTable table)Called when the property reference has been resolved.voidonRowAdded(VSRow row, int index)Called when a row is added.voidonRowRemoved(VSRow row, int index)Called when a row is removed.voidonRowStateChanged(VSRow row, IVSComponentState.State state, boolean on)Called when a row selection state changed.protected voidonSelectionChanged(GEvent event)Method called when the selection of the component changed due to a property change (value changed, property added or removed).voidonSelectionChanged(ITEM_CONTENT item, boolean on)Callback when an item is selected or unselected.voidonSingleSelectionChanged(VSTable table, int index)Called when the single selection changes.voidonStateChanged(VSTable table, IVSComponentState.State state, boolean on)Called when the table changes state.protected voidonVirtualizationCompleted(IAppSessionGyro appGyro, IClientSessionGyro clientGyro, VirtualSpace virtualSpace, PropCnr virtualizedProp, boolean isPostResolve)Called when virtualization completed.voidrefresh()This method is called from any thread to trigger a refresh of the contents of all the container items.protected voidrefresh(int dirty)Requests a refresh of the contents depending on the flag.voidrefresh(ITEM_CONTENT item)This method is called from any thread when an item property container has been changed.ITEM_CONTENTremove(int index)Removes an item at the specified index.booleanremove(ITEM_CONTENT item)Removes an item.booleanremoveAll()Removes all items.booleansetContentProvider(IContentProvider<ITEM,ITEM_CONTENT> customContentProvider)Sets a custom content provider to be used.java.lang.StringsetSelection(int index)Sets the selection as a single selected item at specified index.protected voidupdate()Called to update the contents if required with new data.booleanuseContentProvider()Returns the flag to use the content provider.booleanverify(PropVerification verification)Verifies this property container.Methods inherited from class com.iizix.prop.ui.UIContainer
addPredefinedProps, addPredefinedPropsImpl, canAcceptUIContainerFocus, createCompsCnr, getApproximateSize, getComponentCount, getComponents, getCompsCnr, getDeviceType, getFirstContainerVSStateFocus, getFirstUIComponent, getFirstUIComponentNull, getRadioSelectionComponents, getSelectedRadioComponent, getUIComponent, getUIComponentNull, getVSStateFocus, hasImplicitAlignFillX, hasImplicitAlignFillY, isMobileContextMenuSupported, mustHaveHeight, mustHaveWidth, onBroken, onComponentSelectedInParent, onResolved, onSelectionChanged, onStateChanged, onVSComponentSelectionChanged, resetComponentID, setRadioSelectionComponent, setUIContainerFocus, updateUICompsReference, verifyComponentScope
Methods inherited from class com.iizix.prop.ui.UIComp
add, assignFontInfoResolver, canAlignX, canAlignY, canFillX, canFillY, canRequestFocus, canRequestFocus, clearErrorMessage, couldRequestFocusIfVirtualized, createStyles, createTitleProp, disconnectVSField, enterVSProcessing, exitVSProcessing, fireSelection, fireSelection, forbiddenGetCustomDataMap, getBadge, getBestVSFieldValueType, getComponentID, getComponentMappings, getErrorMessage, getErrorMessage, getErrorMessageEx, getErrorMessageString, getErrorMessageString, getErrorMessageStringEx, getFixHeight, getFixWidth, getFontInfo, getForcedAlignX, getForcedAlignY, getKStringText, getLayout, getLayoutMgr, getLayoutMgr, getMappedVSComponent, getMessage, getMessageText, getPixelHeight, getPixelWidth, getSize, getStyles, getStyles, getText, getTitle, getTitleKS, getTitlePKS, getTooltip, getTooltipText, getTrigger, getUIPanel, getUIParent, getValue, getValue, getVirtualSpace, getVSField, hasExplicitHeight, hasExplicitWidth, hasFocus, hasImplicitHeight, hasImplicitWidth, hasSelectionChanged, isEnabled, isMobile, isReadOnly, isRTL, isVisible, isVSFieldDisconnected, mustHaveExplicitHeight, mustHaveExplicitWidth, onBroken, onFocusGained, onNotifySelectionChanged, onPrepare, onRemoteEvent, onResolved, onStateChanged, onValueChanged, processVSComponentSelection, reconnectVSField, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusEx, requestFocusEx, requestFocusEx, requestFocusEx, setBadge, setBadge, setComponentToVSField, setEnabled, setEnabled, setErrorMessage, setErrorMessage, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setReadOnly, setText, setText, setTitle, setTitle, setTitle, setTooltip, setTooltip, setVisible, setVisible, setVSFieldMessageToComponent, setVSFieldToComponent
Methods inherited from class com.iizix.prop.PropCnr
__transferChildProps, addProp, addProp, addProp2, addProp2, appendPropValue, completeVirtualize, containsProp, containsProp, convertLoadedProp, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, doVirtualizePropCnr, enablePropCommunication, enablePropHashMap, 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, 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
clearErrorMessage, getBadge, getKStringText, getLayoutMgr, getMessage, getMessageText, getStyles, getText, getTooltip, getTooltipText, getUIPanel, getUIParent, isEnabled, isReadOnly, isVisible, messageBox, requestFocus, requestFocus, requestFocusEx, requestFocusEx, setBadge, setBadge, setEnabled, setErrorMessage, setErrorMessage, setHTMLText, setLayoutMgr, setMessage, setMessage, setReadOnly, setText, setText, setTooltip, setTooltip, setVisible
Methods inherited from interface com.iizix.prop.ICustomDataProvider
forbiddenGetCustomDataMap, getCustomData, putCustomData, putCustomDataIfAbsent
Methods inherited from interface com.iizix.gyro.IFocusComp
requestFocus, requestFocus, requestFocusEx, requestFocusEx
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, onRemoteEvent, 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, canRequestFocus, canRequestFocus, containsProp, containsProp, couldRequestFocusIfVirtualized, 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, hasFocus, 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, requestFocus, requestFocusEx, 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.IUIActionHolder
getBaseJavaReference
Methods inherited from interface com.iizix.prop.ui.IUIComp
canAcceptUIContainerFocus, disconnectVSField, getComponentID, getComponentMappings, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getDeviceType, getErrorMessage, getErrorMessage, getFirstUIComponent, getFirstUIComponentNull, getFixHeight, getFixWidth, getLayout, getLayoutMgr, getPanelUIComponent, getPanelUIComponentNull, getUIRef, getValue, getValue, getVirtualSpace, getVSField, isMobile, isRTL, isVSFieldDisconnected, reconnectVSField, setComponentToVSField, setErrorMessage, setErrorMessage, setUIContainerFocus, setVSFieldMessageToComponent, setVSFieldToComponent
Methods inherited from interface com.iizix.prop.ui.IUIContextMenuOwner
getContainedContextMenu, getContextMenu, getReferencedContextMenu, isContextMenuSupported, onBroken, onResolved
Methods inherited from interface com.iizix.prop.ui.IUIFocusComp
onFocusGained, onFocusLost
Methods inherited from interface com.iizix.prop.ui.selection.IUIIndexedSelectionComp
isSelectionIndexBased, setSelection, setSelection, setSelection, setSelection, setSelection
Methods inherited from interface com.iizix.prop.ui.selection.IUISelectionComp
addSelectionListener, isSelectionBooleanBased, isSelectionCellBased, isSelectionTriStateBased, removeSelectionListener, setSelection
Methods inherited from interface com.iizix.prop.ui.selection.IUISingleIndexedSelectionComp
getFirstSelectedIndex, setSelection
Methods inherited from interface com.iizix.prop.vs.IVSFieldListener
getBestVSFieldValueType, onBroken, onResolved, onStateChanged, onValueChanged
Field Detail
TABLE_REF_PROP_NAME
public static final java.lang.String TABLE_REF_PROP_NAME
Property name for VSTableReference.- See Also:
- Constant Field Values
USE_CONTENT_PROVIDER_PROP_NAME
public static final java.lang.String USE_CONTENT_PROVIDER_PROP_NAME
Property name for the setting of "use content provider" (defaults to "false").- See Also:
- Constant Field Values
PN_SELECTION_TYPE
protected static final java.lang.String PN_SELECTION_TYPE
The property name: selection type "selType".- See Also:
- Constant Field Values
Constructor Detail
AbstractContentUIContainer
public AbstractContentUIContainer()
Creates the content property container.
AbstractContentUIContainer
public AbstractContentUIContainer(Atom atom)
Creates the content property container.- Parameters:
atom- The atom name.
Method Detail
getPredefinedProps
public void getPredefinedProps()
Gets potential references to predefined properties for this container. This method is called once just after cloning of the property container.The method should get reference to using the
getProp(...)methods. This allows the subclass to be able to retrieve the new instances to the properties created duringaddPredefinedProps()if stored in instance variables.Subclasses must override this method to do the appropriate initialization, as this method does nothing for the PropCnr class implementation.
- Overrides:
getPredefinedPropsin classUIContainer
equalsTree
protected java.lang.Object equalsTree(PropCnr pc2, int how)
Checks for equality in the whole container structure.NOTE: This method should not be overridden except in extreme situations, e.g. for MememtoPropCnr.
- Overrides:
equalsTreein classPropCnr- Parameters:
pc2- The property value to compare with.how- Flags EQC_* values for equal checking.- Returns:
- Both atom and value are equal on all levels.
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.
getOnUISelectionMethod
public final java.lang.reflect.Method getOnUISelectionMethod()
Returns the method to use for onUISelection notifications that is attached to this selection component. The method name is not important, but must have the annotation and signature:@OnUISelection(name = "some/property")
public void onUISelection(UISelectionEvent event)- Specified by:
getOnUISelectionMethodin interfaceIUISelectionComp- Returns:
- The method, or null if none is registered.
getOnUIActionMethod
public final java.lang.reflect.Method getOnUIActionMethod()
Gets the method for the OnUIAction event at runtime. The method can be stored in another instance, e.g. a group holding multiple action items.- Specified by:
getOnUIActionMethodin interfaceIUIActionHolder- Returns:
- The method for OnUIAction event, null for none.
isBackReferenceValid
public java.lang.String isBackReferenceValid(AnnotationType annotationType, java.lang.String name, boolean isRefOnly)
Validates if the back-reference specified is referenced in the first place, i.e. is valid or not.- Specified by:
isBackReferenceValidin interfaceIBackReferenceProvider- Parameters:
annotationType- The annotation type.name- The class or method name.isRefOnly- Flag indicating the back reference is not required, but must be valid otherwise.- Returns:
- null for valid, otherwise an error message.
clone
public AbstractContentUIContainer<ITEM,ITEM_CONTENT> clone()
Clones this instance.- Overrides:
clonein classUIContainer- Returns:
- The new cloned instance.
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 classUIComp- 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.
onPropParentChanged
protected void onPropParentChanged(PropCnr oldParent, PropCnr newParent)
Called when the parent is changed for this class. The default implementation does nothing and must be overridden by subclasses.- Overrides:
onPropParentChangedin classGProp<GProp<?>[]>- Parameters:
oldParent- The old parent (or null if none).newParent- The new parent (or null if none).
onPropDispose
protected void onPropDispose()
Called when disposed of.- Overrides:
onPropDisposein classUIComp
onEventSelf
public void onEventSelf(GEvent event)
Event checking to clear cache.- Specified by:
onEventSelfin interfaceIGProp<ITEM extends IContentItem>- Overrides:
onEventSelfin classUIComp- Parameters:
event- The property event.
onItemAdded
protected void onItemAdded(ITEM item)
Item added event.Subclasses can implements its routine to initialize the required object that governs the API behavior of the property.
Do not forget to FIRST call the
super.onItemAdded(item)if overridden.- Parameters:
item- The item added.
onItemRemoved
protected void onItemRemoved(ITEM item)
Item removed event.Subclasses can implements its routine to clean-up a potentially required object that governs the API behavior of the property.
Do not forget to FIRST call the
super.onItemRemoved(item)if overridden.- Parameters:
item- The item removed.
getItems
public ITEM[] getItems()
Gets the container items.- Returns:
- A cached array of items, DO NOT MODIFY the array.
refresh
public void refresh()
This method is called from any thread to trigger a refresh of the contents of all the container items. This method should be also be called when the item count has changed.
refresh
public void refresh(ITEM_CONTENT item)
This method is called from any thread when an item property container has been changed.- Parameters:
item- The item to refresh.
getVSTableReferenceOwnerData
public VSReferenceOwnerData<VSTable,VSTableReference> getVSTableReferenceOwnerData()
Gets the table reference owner data for the table column reference.- Specified by:
getVSTableReferenceOwnerDatain interfaceIVSTableColumnReferenceOwner- Returns:
- The VSReferenceOwnerData instance, always non-null.
getVSTable
public final VSTable getVSTable()
Gets the VSTable.- Returns:
- The table for the reference, or null if not found.
getVSTable
public final VSTable getVSTable(VSTableColumnReference ref)
Gets the VSTable for a VSTableColumnReference instance.- Specified by:
getVSTablein interfaceIVSTableColumnReferenceOwner- Parameters:
ref- The reference instance, null when property-editing the reference in the Designer.- Returns:
- The table for the reference, or null if not found.
getContentTable
public VSTable getContentTable()
Gets the VS table that is associated with the container to provide the items.- Returns:
- The table connected, or null for none.
getContentTableColumns
public int[] getContentTableColumns()
Gets the connected VS table columns in the table.- Returns:
- The array of VS table column indicies, or null if a content provider is not used. Note that an instance in the array may be -1 if not connected.
Note: this array is cached AND SHOULD NOT BE MODIFIED.
onResolved
public void onResolved(VSRelativeReference<?> reference, VSTable table)
Called when the property reference has been resolved. UI components use this method to set its state according to the field.- Specified by:
onResolvedin interfaceIVSTableListener- Parameters:
reference- The VSRelativeReference instance holding the reference.table- The target reference.
onBroken
public void onBroken(VSRelativeReference<?> reference, VSTable table)
Called when the property reference has been broken, i.e. unresolved.- Specified by:
onBrokenin interfaceIVSTableListener- Parameters:
reference- The VSRelativeReference instance holding the reference.table- The target reference.
onStateChanged
public void onStateChanged(VSTable table, IVSComponentState.State state, boolean on)
Called when the table changes state.- Specified by:
onStateChangedin interfaceIVSTableListener- Parameters:
table- The VS table.state- The state change.on- New state.
onSingleSelectionChanged
public void onSingleSelectionChanged(VSTable table, int index)
Called when the single selection changes.- Specified by:
onSingleSelectionChangedin interfaceIVSTableListener- Parameters:
table- The table.index- The row index, -1 if table is unselected.
onParentStateChanged
public void onParentStateChanged(IVSComponent parent, IVSComponentState.State state, boolean on)
Called when the parent changes state.- Specified by:
onParentStateChangedin interfaceIVSComponentListener- Overrides:
onParentStateChangedin classUIComp- Parameters:
parent- The parent who's state was changed.state- The state change, possible values PARENT_ENABLED, PARENT_READONLY, PARENT_VISIBLE.on- New state.
onRowAdded
public void onRowAdded(VSRow row, int index)
Called when a row is added.- Specified by:
onRowAddedin interfaceIVSTableListener- Parameters:
row- The row.index- The index.
onRowRemoved
public void onRowRemoved(VSRow row, int index)
Called when a row is removed.- Specified by:
onRowRemovedin interfaceIVSTableListener- Parameters:
row- The row.index- The index.
onRowStateChanged
public void onRowStateChanged(VSRow row, IVSComponentState.State state, boolean on)
Called when a row selection state changed.- Specified by:
onRowStateChangedin interfaceIVSTableListener- Parameters:
row- The row.state- The state change.on- New state.
onCellStateChanged
public void onCellStateChanged(VSField cell, IVSComponentState.State state, boolean on)
Called when the cell changes state.Subclasses may override this method to not perform the default action, i.e. to call
refresh(REFRESH_CONTENTS)and perform a more efficient update of the VSField updated cell state.- Specified by:
onCellStateChangedin interfaceIVSTableListener- Parameters:
cell- The VS cell.state- The state change.on- New state.
onCellValueChanged
public void onCellValueChanged(VSField cell, Value value, GProp<?> trigger, IPostEventProcessing postProcessing)
Called when the cell value is set.Subclasses may override this method to not perform the default action, i.e. to call
refresh(REFRESH_CONTENTS)and perform a more efficient update of the VSField cell updated.- Specified by:
onCellValueChangedin interfaceIVSTableListener- Parameters:
cell- 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.
getBestVSColumnHeaderValueType
public Value.Type getBestVSColumnHeaderValueType(VSRelativeReference<?> reference)
Requests the value type that would best suit the listener.- Specified by:
getBestVSColumnHeaderValueTypein interfaceIVSColumnBestValueListener- Parameters:
reference- The VSRelativeReference instance holding the reference.- Returns:
- null if none is available.
useContentProvider
public boolean useContentProvider()
Returns the flag to use the content provider.- Returns:
- true if the content provider is used with API or VirtualSpace support, false if items are as defined in the Designer.
setContentProvider
public boolean setContentProvider(IContentProvider<ITEM,ITEM_CONTENT> customContentProvider)
Sets a custom content provider to be used. A full refresh will automatically be done.- Parameters:
customContentProvider- The custom content provider.- Returns:
- true for success, false if content provider support is not enabled for the container due to the settings, or the same content provider is set twice.
getItemCount
public int getItemCount()
Returns the item count.- Returns:
- The current count of items.
getItem
public ITEM getItem(int index)
Gets an item at specified index.- Parameters:
index- The index of the item property.- Returns:
- The property at specified index, null if not found.
createContentProvider
protected IContentProvider<ITEM,ITEM_CONTENT> createContentProvider()
Creates the content provider.- Returns:
- The created content provider.
getContentProvider
protected IContentProvider<ITEM,ITEM_CONTENT> getContentProvider()
Gets the or created content provider to use.- Returns:
- A content provider, custom if defined and successfully created.
getVSColumnIndex
protected int getVSColumnIndex(java.lang.Object nameOrAtom)
Gets the table column reference property with the String or Atom. This call makes it possible to redirect the reference into another container, e.g. for the MList default item. By default, the property is taken from this container.- Parameters:
nameOrAtom- The String name or Atom name.- Returns:
- The VS table column index found, or -1 for none.
hasDiscreteContentChanges
public boolean hasDiscreteContentChanges(boolean reset)
Flag for contents changes for API when content provider is using discrete components added by the user.- Parameters:
reset- Flag to reset changes.- Returns:
- true if the contents array is changes since last call (that was reset), false otherwise.
getAPIContentProvider
public IContentProviderAPI<ITEM,ITEM_CONTENT> getAPIContentProvider()
Gets the content provider for the API.- Returns:
- The content provider, or null if API is not supported or none is set.
refresh
protected final void refresh(int dirty)
Requests a refresh of the contents depending on the flag.This method is called e.g. when a new column is added to rebuild the table contents. Be careful when calling this method as it may cause a lot of processing at a later stage, triggering new contents to be sent to the client side. The content is not refreshed upon returning from the call, it is done at a later stage.
- Parameters:
dirty- The dirty flags.
update
protected void update()
Called to update the contents if required with new data. The method does nothing if e.g. a call torefresh(int)hasn't been called.
isUpdatingInCurrentThread
public boolean isUpdatingInCurrentThread(boolean refreshVS)
Checks if the current thread is currently in updates mode (with updates from VS).- Parameters:
refreshVS- Flag indicating only VS refreshing must be tested, not other changes in e.g. the UI.- Returns:
- true If updates are currently being done, false otherwise.
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.
- Overrides:
addMappingsin classUIComp- 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.
addMappingsTable
protected void addMappingsTable(java.lang.String uiRef, VSMappings mappings, VSComponent vsStateFocus)Gets the VSTable mappings of a VirtualSpace to the panel components. Override this method to add mappings when the contents is connected to a table and the items are perhaps not yet created.The default is to find the relative references to VS and add those references. Override to provide other functionality.
- Parameters:
uiRef- The reference property name of "uiComp", null if not yet retrieved.mappings- The mappings instance to fill in.vsStateFocus- Do not go past this component when going up in the parent tree, null for none.
isEmptyContainerAllowed
public boolean isEmptyContainerAllowed()
Returns whether the container should have children in a normal conditions, i.e. a warning message should be displayed in the Designer when it is empty. This is intended to be used to avoid use of empty containers. Some containers, e.g. the mobile heading is allowed to be empty.- Overrides:
isEmptyContainerAllowedin classUIContainer- Returns:
- true if a VS table is connected and the content provider is set, false otherwise.
verify
public boolean verify(PropVerification verification)
Verifies this property container. The check performed is the extension of classes and that no circular reference is present.- Specified by:
verifyin interfaceIGProp<ITEM extends IContentItem>- Overrides:
verifyin classUIContainer- Parameters:
verification- The property verification class.- Returns:
- true if verification should proceed, false if disposed of and verification should not take place.
getItemClass
public abstract java.lang.Class<ITEM> getItemClass()
Return the class of items stored in the container.- Returns:
- The property container class for items.
getItemContentClass
public abstract java.lang.Class<ITEM_CONTENT> getItemContentClass()
Return the class of content items stored in the container.- Returns:
- The property container class for content items.
createItem
protected abstract ITEM createItem(Atom atom, ITEM_CONTENT data)
Creates a new property item from an item data holder and initializes the property.- Parameters:
atom- The name of the item property.data- The data to initialize the item property with.- Returns:
- The item property.
createDefaultContentProvider
protected abstract IContentProvider<ITEM,ITEM_CONTENT> createDefaultContentProvider()
Creates and returns a new instance of a default content provider.- Returns:
- The default content provider to use.
getContentTableColumnReferenceNames
protected abstract java.lang.Object[] getContentTableColumnReferenceNames()
Gets the atoms of the references that are used to specify the VS column header connections for the VS table.- Returns:
- The array of atoms or Strings.
getBestVSColumnHeaderValueTypes
protected abstract Value.Type[] getBestVSColumnHeaderValueTypes()
Gets the value type that would best suit the for the columns.- Returns:
- null if none is available.
getSelectionPropAtom
public Atom getSelectionPropAtom()
Returns the selection property atom for verification of selection changes.This method is used by the framework in UIComp to fire selection events when the property value changes.
- Specified by:
getSelectionPropAtomin interfaceIUISelectionComp- Returns:
- null, as the selection property is not property based.
getSelectionListenerHandler
public GenericListener<IUISelectionListener> getSelectionListenerHandler(boolean doCreate)
Returns the generic selection listener.- Specified by:
getSelectionListenerHandlerin interfaceIUISelectionComp- Parameters:
doCreate- Create the listener handler if it doesn't exist, false not to.- Returns:
- The selection listener handler, or null if not created.
add
public void add(ITEM_CONTENT item)
Adds a new item to the end of the list. Duplicates are not allowed.- Parameters:
item- The item to insert.- Throws:
java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions, or if the item already is present in the list. This exception is also thrown if the content provider is not used or does not support API usage.
add
public void add(int index, ITEM_CONTENT item)Inserts a new item before the specified index. Duplicates are not allowed.- Parameters:
index- The insertion point index, -1 for last.item- The item to insert.- Throws:
java.lang.IndexOutOfBoundsException- If the index is not valid.java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions, or if the item already is present in the list. This exception is also thrown if the content provider is not used or does not support API usage.
remove
public ITEM_CONTENT remove(int index)
Removes an item at the specified index.- Parameters:
index- The item to remove.- Returns:
- The removed item, null if a content provider is not present.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is not valid.java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions. This exception is also thrown if the content provider is not used or does not support API usage.
remove
public boolean remove(ITEM_CONTENT item)
Removes an item.- Parameters:
item- The item to remove.- Returns:
- true for success, false if not found.
- Throws:
java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions. This exception is also thrown if the content provider is not used or does not support API usage.
removeAll
public boolean removeAll()
Removes all items.- Returns:
- true for changed, false when no items were present.
- Throws:
java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions. This exception is also thrown if the content provider is not used or does not support API usage.
get
public ITEM_CONTENT get(int index)
Gets an item at the specified index.- Parameters:
index- The index of the item.- Returns:
- The item.
- Throws:
java.lang.IndexOutOfBoundsException- If the index is not valid.java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions. This exception is also thrown if the content provider is not used or does not support API usage.
getAll
public ITEM_CONTENT[] getAll()
Gets all items.- Returns:
- The array of items.
- Throws:
java.lang.IllegalStateException- This exception is also thrown if the content provider is not used.
indexOf
public int indexOf(ITEM_CONTENT item)
Returns the index of an item.- Parameters:
item- The item to look-up.- Returns:
- The index of the item, or -1 if not found.
- Throws:
java.lang.IllegalStateException- When the VirtualSpace is connected and changes must be done from there and not by means of API functions.
getSelectionType
public int getSelectionType()
Gets the selection type of the component.- Specified by:
getSelectionTypein interfaceIUISelectionComp- Returns:
- A value indicating the selection capability as the SELECTION_TYPE_* values define.
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).- Overrides:
onSelectionChangedin classUIContainer- Parameters:
event- The event that causes the selection change.
onSelectionChanged
public void onSelectionChanged(ITEM_CONTENT item, boolean on)
Callback when an item is selected or unselected.This method should not be called! It is intended for the frameworks item
setSelection(boolean)method.- Parameters:
item- The item who's selection state changed.
isSelected
public boolean isSelected()
Returns the selection of state of the component.For a multiple-selection capable component, this indicates any selection, i.e. true is returned as soon as at least one element is selected, false for none.
The checkbox for example has two "selected states": checked and third state: in this case, true is returned for the third state as well as the checked state.
- Specified by:
isSelectedin interfaceIUISelectionComp- Returns:
- true if the component is selected, false otherwise.
getSelectedIndex
public int getSelectedIndex()
Gets the first selected index.- Specified by:
getSelectedIndexin interfaceIUISingleIndexedSelectionComp- Returns:
- The first index in the current selection, or -1 for none.
getSelectedIndicies
public int[] getSelectedIndicies()
Gets the selected indicies.- Specified by:
getSelectedIndiciesin interfaceIUIIndexedSelectionComp- Specified by:
getSelectedIndiciesin interfaceIUISingleIndexedSelectionComp- Returns:
- A new array of the selected indices (that may be modified to your liking), or a static zero in length array for no selection.
getSelection
public IUISelection getSelection()
Gets the current selection of the component.- Specified by:
getSelectionin interfaceIUISelectionComp- Returns:
- The current selection of the component.
setSelection
public java.lang.String setSelection(int index)
Sets the selection as a single selected item at specified index.- Specified by:
setSelectionin interfaceIUIIndexedSelectionComp- Parameters:
index- The single item to select at index, negative value to clear the selection.- Returns:
- null for success, otherwise an error message why the selection failed.
clearSelection
public java.lang.String clearSelection()
Clear the selection.- Specified by:
clearSelectionin interfaceIUIIndexedSelectionComp- Returns:
- null for OK.