ADAPTER
- is the generic type of AbstractUiWidgetNative.getWidgetAdapter()
.NODE
- is the generic type of the tree-nodes. E.g. TreeNode
.public abstract class AbstractUiWidgetTree<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE> extends AbstractUiWidgetAbstractDataSet<ADAPTER,NODE,NODE,NODE> implements UiWidgetTree<NODE>
UiWidgetAbstractListTable
.AbstractUiWidgetNative.SizeImpl
AbstractUiWidget.AccessHelper, AbstractUiWidget.EventSender, AbstractUiWidget.HandlerContainer
UiWidgetAbstractTree.UiTreeModel<NODE>, UiWidgetAbstractTree.UiTreeModelMutable<NODE>, UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,WIDGET extends UiWidgetRegular>, UiWidgetAbstractTree.UiTreeNodeRendererDefault<NODE>, UiWidgetAbstractTree.UiWidgetTreeNode<NODE>
Modifier and Type | Field and Description |
---|---|
private static UiWidgetAbstractTree.UiTreeNodeRenderer<Object,UiWidgetLabel> |
DEFAULT_RENDERER
The default
UiWidgetAbstractTree.UiTreeNodeRenderer . |
private String |
title |
private UiWidgetAbstractTree.UiTreeModel<NODE> |
treeModel |
private UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> |
treeNodeRenderer |
STYLE_TREE
STYLE_HEADER
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
PROPERTY_SUMMARY
PROPERTY_TITLE
ACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEY
Constructor and Description |
---|
AbstractUiWidgetTree(UiContext context,
ADAPTER widgetAdapter)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
collapseAllNodes()
This method collapses all nodes.
|
protected void |
doSetSelected(NODE container,
boolean selected)
Internal method to set the selection of the item in the given
container . |
protected void |
doSetValue(NODE value,
boolean forUser)
This method is called from the
data-binding triggered by API methods such as
AbstractUiWidget.setValue(Object, boolean) . |
void |
expandNodes()
This method expands all nodes that have already been
loaded . |
Collection<NODE> |
getAllAvailableItems()
Internal method to get the
Collection with all items (currently) available in this widget. |
protected NODE |
getItem(NODE container)
This method gets the item in the given
container. |
protected NODE |
getItemContainer(NODE item)
Gets the existing container for the given
item . |
protected NODE |
getLastAvailableItem() |
String |
getTitle()
This method gets the title of this object.
|
UiWidgetAbstractTree.UiTreeModel<NODE> |
getTreeModel()
This method gets the
UiWidgetAbstractTree.UiTreeModel adapting from <NODE> to this tree-widget. |
UiWidgetAbstractTree.UiWidgetTreeNode<NODE> |
getTreeNodeWidget(NODE node)
This method gets the
UiWidgetAbstractTree.UiWidgetTreeNode for the given <NODE>. |
protected void |
initializeWidgetAdapter(ADAPTER adapter)
This method is called from
AbstractUiWidgetNative.getWidgetAdapter() to initialize the UiWidgetAdapter . |
void |
setTitle(String title)
This method sets the title of this object.
|
void |
setTreeModel(UiWidgetAbstractTree.UiTreeModel<NODE> model)
This method sets the
UiWidgetAbstractTree.UiTreeModel adapting from <NODE> to this tree-widget. |
void |
setTreeNodeRenderer(UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> renderer)
This method sets the
UiWidgetAbstractTree.UiTreeNodeRenderer used to render the widgets for an
individual <NODE>. |
addSelectionHandler, asFeatureSelectedValue, clearSelection, doGetSelected, getFirstAvailableItem, getSelectedValue, getSelectedValues, getSelectedValuesInternal, getSelectionCount, getSelectionMode, getSummary, hasSelectedValue, isEditable, isSelected, isTitleVisible, onItemSelection, removeSelectionHandler, setEditable, setSelectedValue, setSelectedValues, setSelectedValues, setSelection, setSelection, setSelectionMode, setSummary, setTitleVisible
addFocusHandler, getAccessKey, isFocused, onAccessKeyPressed, removeFocusHandler, setAccessKey, setFocused, setFocused
addChangeHandler, addStyle, clearMessages, clearValidity, createSize, createUniqueId, createWidgetAdapter, dispose, doGetValue, doSetMode, doValidate, getAriaRole, getAriaRoleFixedType, getChild, getChild, getChildCount, getChildIndex, getId, getIndexOfStyle, getMode, getModeFixed, getParent, getPrimaryStyle, getSize, getStyles, getTooltip, getVisibleFlag, getWidgetAdapter, getWidgetAdapter, hasStyle, hasWidgetAdapter, isDisposed, isEnabled, isModifiedRecursive, isVisible, isVisibleRecursive, removeChangeHandler, removeFromParent, removeStyle, setAriaRole, setEnabled, setId, setIdPrefix, setMode, setMode, setModeFixed, setParent, setPrimaryStyle, setStyles, setTooltip, setVisible, setVisible, toString, visibilityChanged
addEventHandler, addValidator, clearMessagesLocal, clearValidationFailure, convertValueToString, fireEvent, fireValueChange, getBasicUtil, getContext, getDataBinding, getDataBinding, getDataBindingForWidget, getEventSender, getFactory, getLogger, getObserverSource, getOriginalValue, getRecentValue, getSource, getValueClass, getValueDirect, getValueOrException, getWidgetAdapter, hasEventSender, isMandatory, isModified, removeEventHandler, removeFromParent, removeValidator, setMandatory, setModified, setParent, setValue
addValidatorMandatory, createValidationFailure, getValue, getValueAndValidate, handleGetValueError, resetValue, setValue, setValueForUser, validate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asFeatureSelectedValue
getContext, getParent, getSize
clearMessages
addEventHandler, removeEventHandler
setMode
getMode
setModeFixed
getModeFixed
setId
getId
setTooltip
getTooltip
getVisibleFlag, isVisible, setVisible, setVisible
isVisibleRecursive
setEnabled
isEnabled
addStyle, removeStyle
hasStyle
setStyles
getStyles
setPrimaryStyle
getPrimaryStyle
dispose
isDisposed
isModified
getAriaRole
addSelectionHandler, isSelected, removeSelectionHandler, setSelection
setSelectedValue, setSelectedValues
getSelectedValue, getSelectedValues, getSelectionCount, hasSelectedValue
setSelectionMode
getSelectionMode
setSummary
getSummary
setTitleVisible
isTitleVisible
setEditable
isEditable
getValue
getValueAndValidate, getValueDirect
addChangeHandler, removeChangeHandler
resetValue, setValue, setValue, setValueForUser
getOriginalValue, getValueOrException
addValidatorMandatory, isMandatory
addValidator, removeValidator
private static final UiWidgetAbstractTree.UiTreeNodeRenderer<Object,UiWidgetLabel> DEFAULT_RENDERER
UiWidgetAbstractTree.UiTreeNodeRenderer
.private UiWidgetAbstractTree.UiTreeModel<NODE> treeModel
getTreeModel()
private UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> treeNodeRenderer
private String title
getTitle()
public AbstractUiWidgetTree(UiContext context, ADAPTER widgetAdapter)
context
- is the context
.widgetAdapter
- is the widget adapter
. Typically null
for
lazy initialization.protected void initializeWidgetAdapter(ADAPTER adapter)
AbstractUiWidgetNative.getWidgetAdapter()
to initialize the UiWidgetAdapter
. All
attributes of this widget need to be set in the UiWidgetAdapter
.initializeWidgetAdapter
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
adapter
- is the UiWidgetAdapter
to initialize.public void setTreeModel(UiWidgetAbstractTree.UiTreeModel<NODE> model)
UiWidgetAbstractTree.UiTreeModel
adapting from <NODE> to this tree-widget.setTreeModel
in interface UiWidgetAbstractTree<NODE>
model
- is the UiWidgetAbstractTree.UiTreeModel
to set.public void setTreeNodeRenderer(UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> renderer)
UiWidgetAbstractTree.UiTreeNodeRenderer
used to render the widgets
for an
individual <NODE>.setTreeNodeRenderer
in interface UiWidgetAbstractTree<NODE>
renderer
- is the UiWidgetAbstractTree.UiTreeNodeRenderer
.public UiWidgetAbstractTree.UiWidgetTreeNode<NODE> getTreeNodeWidget(NODE node)
UiWidgetAbstractTree.UiWidgetTreeNode
for the given <NODE>. It contains a
node widget
that was created by the UiWidgetAbstractTree.UiTreeNodeRenderer
.
Further you can collapse or expand
the node.getTreeNodeWidget
in interface UiWidgetAbstractTree<NODE>
node
- is the <NODE>.UiWidgetAbstractTree.UiWidgetTreeNode
or null
if the given node
is NOT
in this tree.UiWidgetAbstractTree.setTreeNodeRenderer(UiTreeNodeRenderer)
public void collapseAllNodes()
collapseAllNodes
in interface UiWidgetAbstractTree<NODE>
public void expandNodes()
loaded
.expandNodes
in interface UiWidgetAbstractTree<NODE>
public UiWidgetAbstractTree.UiTreeModel<NODE> getTreeModel()
UiWidgetAbstractTree
UiWidgetAbstractTree.UiTreeModel
adapting from <NODE> to this tree-widget.getTreeModel
in interface UiWidgetAbstractTree<NODE>
public String getTitle()
getTitle
in interface AttributeReadStringTitle
getTitle
in interface UiWidgetAbstractDataSet<NODE>
getTitle
in interface AttributeReadTitle<String>
getTitle
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
public void setTitle(String title)
setTitle
in interface AttributeWriteStringTitle
setTitle
in interface UiWidgetAbstractDataSet<NODE>
setTitle
in interface AttributeWriteTitle<String>
setTitle
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
title
- is the new title.AttributeWriteTitleVisible.setTitleVisible(boolean)
protected void doSetValue(NODE value, boolean forUser)
data-binding
triggered by API methods such as
AbstractUiWidget.setValue(Object, boolean)
. In many cases the data-binding
already
performs the required work to do. However, here is the place to implemented the custom logic to get the
value from the actual widget. For details see AbstractUiWidget.doGetValue(Object, ValidationState)
.doSetValue
in class AbstractUiWidgetNative<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE>
value
- is the value to set. Typically a composite object (e.g. java bean) so its attributes are set
to fields (see UiWidgetField
).forUser
- true
if called from AbstractUiFeatureValueAndValidation.setValueForUser(Object)
, false
if
set from AbstractUiFeatureValueAndValidation.setValue(Object)
.AbstractUiWidget.doGetValue(Object, ValidationState)
protected void doSetSelected(NODE container, boolean selected)
container
. Shall not do
anything else (e.g. firing event).doSetSelected
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
container
- is the container with the item to mark.selected
- - true
to select, false
to deselect.public Collection<NODE> getAllAvailableItems()
Collection
with all items (currently) available in this widget. In
case of lazy loading only those that have already been loaded. Collection
must NOT be modified if retrieved via this method. Implementations will provide
separate addItem
and removeItem
methods.getAllAvailableItems
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
Collection
with all items (currently) available in this widget. In case of lazy
loading only those that have already been loaded.protected NODE getLastAvailableItem()
getLastAvailableItem
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
last
of the available items
.protected NODE getItemContainer(NODE item)
item
. This method has to be very efficient. You
should use a Map
for this purpose.getItemContainer
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
item
- is the item to lookup.item
or null
if no such container exists.protected NODE getItem(NODE container)
container.
getItem
in class AbstractUiWidgetAbstractDataSet<ADAPTER extends UiWidgetAdapterTree<NODE>,NODE,NODE,NODE>
container
- is the container of the requested item.Copyright © 2001–2016 mmm-Team. All rights reserved.