NODE
- is the generic type of the tree-nodes.public class UiWidgetAdapterGwtTree<NODE> extends UiWidgetAdapterGwtWidgetActive<com.google.gwt.user.client.ui.FlowPanel> implements UiWidgetAdapterTree<NODE>
UiWidgetAdapterTree
using GWT based on Tree
.Modifier and Type | Class and Description |
---|---|
private class |
UiWidgetAdapterGwtTree.EventAdapterGwtTree |
protected class |
UiWidgetAdapterGwtTree.TreeNodeAdapter
This inner class adapts from <NODE> to
TreeItem . |
Modifier and Type | Field and Description |
---|---|
private Map<NODE,UiWidgetAdapterGwtTree.TreeNodeAdapter> |
nodeMap
Maps from <NODE> to
UiWidgetAdapterGwtTree.TreeNodeAdapter . |
private NODE |
rootNode |
private UiWidgetAdapterGwtTree.TreeNodeAdapter |
rootNodeAdapter
|
private com.google.gwt.user.client.ui.ScrollPanel |
scrollPanel |
private SelectionMode |
selectionMode |
private com.google.gwt.user.client.ui.InlineLabel |
titleHeader |
private com.google.gwt.user.client.ui.Tree |
tree |
private UiWidgetAbstractTree.UiTreeModel<NODE> |
treeModel |
private UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> |
treeNodeRenderer |
TAB_INDEX_NONE
HTML_ATTRIBUTE_ID, ID_SEPARATOR, PROPERTY_ID
PROPERTY_STYLES, STYLE_PATTERN_MULTIPLE, STYLE_PATTERN_SINGLE
WAI_ARIA
ACCESS_KEY_NONE, HTML_ATTRIBUTE_ACCESS_KEY
PROPERTY_SUMMARY
PROPERTY_TITLE
PROPERTY_LABEL
ATTRIBUTE_COLSPAN
Constructor and Description |
---|
UiWidgetAdapterGwtTree()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyEventAdapterForSelection(EventAdapterGwt adapter)
Applies for
EventType.SELECTION_CHANGE events. |
protected void |
clearMultiSelection()
Clear
SimpleCheckBox es of SelectionMode.MULTIPLE_SELECTION . |
void |
collapseAllNodes() |
protected EventAdapterGwt |
createEventAdapter(UiFeatureEvent source,
UiHandlerEvent sender)
This method creates the
AbstractUiWidgetAdapterWithEvents.getEventAdapter() instance. |
protected com.google.gwt.user.client.ui.FlowPanel |
createToplevelWidget()
This method creates the
underlying widget . |
private UiWidgetAdapterGwtTree.TreeNodeAdapter |
createTreeNodeAdapter(NODE node) |
void |
expandNodes() |
com.google.gwt.user.client.ui.Tree |
getGwtTree() |
com.google.gwt.user.client.ui.ScrollPanel |
getScrollPanel() |
protected com.google.gwt.dom.client.Element |
getSizeElement() |
String |
getSummary()
This method gets the summary of this object.
|
com.google.gwt.user.client.ui.InlineLabel |
getTitleHeader() |
UiWidgetAbstractTree.UiWidgetTreeNode<NODE> |
getTreeNodeWidget(NODE node) |
protected AbstractUiWidgetTree<?,NODE> |
getUiWidgetTyped()
This method is a design suggestion for implementations of widget adapters that need typed access to
AbstractUiWidgetAdapter.getUiWidget() and want to perform the cast only in a single place. |
protected com.google.gwt.user.client.ui.Focusable |
getWidgetAsFocusable() |
protected com.google.gwt.event.dom.client.HasAllFocusHandlers |
getWidgetAsHasAllFocusHandlers() |
protected com.google.gwt.event.dom.client.HasKeyPressHandlers |
getWidgetAsKeyPressHandlers() |
boolean |
isTitleVisible()
|
private void |
onOpenEvent(com.google.gwt.event.logical.shared.OpenEvent<com.google.gwt.user.client.ui.TreeItem> event) |
void |
setEnabled(boolean enabled)
This method sets the
enabled status of this object. |
void |
setRootNode(NODE node) |
void |
setSelectionMode(SelectionMode selectionMode)
This method sets the
selection mode . |
void |
setSummary(String summary)
This method sets the
summary of this object. |
void |
setTitle(String title)
This method sets the title of this object.
|
void |
setTitleVisible(boolean titleVisible)
This method sets the
titleVisible flag of this object. |
void |
setTreeModel(UiWidgetAbstractTree.UiTreeModel<NODE> treeModel) |
void |
setTreeNodeRenderer(UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> renderer) |
applyEventAdapterForClick, applyEventAdapterForFocus, getKeyboardFilter, getWidgetAsHasBlurHandlers, getWidgetAsHasFocusHandlers, setAccessKey, setClickEventSender, setFocused, setKeyboardFilter
dispose, getActiveWidget, removeFromParent
addHandlerRegistration, addStyle, createAbsoluteImageUrl, getHeightInPixel, getImage, getImageParentElement, getLength, getToplevelWidget, getToplevelWidget, getWidthInPixel, isStyleDeltaSupported, removeStyle, setAttribute, setId, setImage, setLength, setPrimaryStyle, setStyles, setTooltip, setVisible
applyEventAdapter, applyEventAdapterForChange, getEventAdapter, setEventSender
createLabel, getAccessKey, getAltText, getAttribute, getBundle, getColumnSpan, getContext, getHeightInRows, getId, getLabel, getMaximumTextLength, getPrimaryStyle, getSelectionMode, getStyles, getTitle, getTooltip, getToplevelWidget, getUiWidget, getUrl, getValidationFailure, hasStyle, isDisposed, isEnabled, isFocused, isResizable, setMode, setParent, setUiWidget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createAbsoluteImageUrl, createLabel, getToplevelWidget, isStyleDeltaSupported, removeFromParent, setEventSender, setMode, setParent, setVisible
setId
getId
setTooltip
getTooltip
isEnabled
addStyle, removeStyle
hasStyle
setStyles
getStyles
setPrimaryStyle
getPrimaryStyle
dispose
isDisposed
setLength
getLength
getHeightInPixel, getWidthInPixel
getAttribute
setAttribute
isFocused
setFocused
setAccessKey
getAccessKey
getSelectionMode
getTitle
private NODE rootNode
setRootNode(Object)
private UiWidgetAbstractTree.UiTreeModel<NODE> treeModel
#setTreeModel(UiTreeModel)
private UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> treeNodeRenderer
#setTreeNodeRenderer(UiTreeNodeRenderer)
private Map<NODE,UiWidgetAdapterGwtTree.TreeNodeAdapter> nodeMap
UiWidgetAdapterGwtTree.TreeNodeAdapter
.private com.google.gwt.user.client.ui.InlineLabel titleHeader
setTitle(String)
private com.google.gwt.user.client.ui.Tree tree
getGwtTree()
private com.google.gwt.user.client.ui.ScrollPanel scrollPanel
getScrollPanel()
private SelectionMode selectionMode
setSelectionMode(SelectionMode)
private UiWidgetAdapterGwtTree.TreeNodeAdapter rootNodeAdapter
public void setTreeModel(UiWidgetAbstractTree.UiTreeModel<NODE> treeModel)
setTreeModel
in interface UiWidgetAdapterTree<NODE>
treeModel
- is the UiWidgetAbstractTree.UiTreeModel
.public void setTreeNodeRenderer(UiWidgetAbstractTree.UiTreeNodeRenderer<NODE,?> renderer)
setTreeNodeRenderer
in interface UiWidgetAdapterTree<NODE>
renderer
- is the UiWidgetAbstractTree.UiTreeNodeRenderer
.UiWidgetAdapterTree#setTreeNodeRenderer(UiTreeNodeRenderer)
public void setSelectionMode(SelectionMode selectionMode)
selection mode
. SelectionMode
immediately after creating the object. The initial
default is always SelectionMode.SINGLE_SELECTION
. Dynamically changing the SelectionMode
may be expensive or not be supported (in exotic implementations) and should therefore be avoided.setSelectionMode
in interface AttributeWriteSelectionMode
selectionMode
- is the new SelectionMode
.protected void clearMultiSelection()
SimpleCheckBox
es of SelectionMode.MULTIPLE_SELECTION
.public UiWidgetAbstractTree.UiWidgetTreeNode<NODE> getTreeNodeWidget(NODE node)
getTreeNodeWidget
in interface UiWidgetAdapterTree<NODE>
node
- is the <NODE>.UiWidgetAbstractTree.UiWidgetTreeNode
or null
.UiWidgetAdapterTree.getTreeNodeWidget(Object)
public void collapseAllNodes()
collapseAllNodes
in interface UiWidgetAdapterTree<NODE>
UiWidgetAdapterTree.collapseAllNodes()
public void expandNodes()
expandNodes
in interface UiWidgetAdapterTree<NODE>
UiWidgetAdapterTree.expandNodes()
public void setRootNode(NODE node)
setRootNode
in interface UiWidgetAdapterTree<NODE>
node
- is the root node.private UiWidgetAdapterGwtTree.TreeNodeAdapter createTreeNodeAdapter(NODE node)
node
- is the <NODE> to wrap.UiWidgetAdapterGwtTree.TreeNodeAdapter
for the given node
.protected EventAdapterGwt createEventAdapter(UiFeatureEvent source, UiHandlerEvent sender)
AbstractUiWidgetAdapterWithEvents.getEventAdapter()
instance. It should to be implemented by the top-level
widget-adapter class specific for a native UI toolkit. It may further be overridden to use a sub-class
instead when more specific behavior is needed.createEventAdapter
in class UiWidgetAdapterGwt<com.google.gwt.user.client.ui.FlowPanel>
source
- is the source of the events (typically UiWidget
).sender
- is the sender of events (an adapter that delegates to the individual handlers/listeners).event adapter
.protected void applyEventAdapterForSelection(EventAdapterGwt adapter)
EventType.SELECTION_CHANGE
events.applyEventAdapterForSelection
in class AbstractUiWidgetAdapterWithEvents<com.google.gwt.user.client.ui.FlowPanel,EventAdapterGwt>
adapter
- is the event adapter
.protected com.google.gwt.user.client.ui.Focusable getWidgetAsFocusable()
getWidgetAsFocusable
in class UiWidgetAdapterGwtWidgetActive<com.google.gwt.user.client.ui.FlowPanel>
widget
as Focusable
or null
if NOT
supported.protected com.google.gwt.event.dom.client.HasKeyPressHandlers getWidgetAsKeyPressHandlers()
getWidgetAsKeyPressHandlers
in class UiWidgetAdapterGwtWidgetActive<com.google.gwt.user.client.ui.FlowPanel>
widget
as HasKeyPressHandlers
or null
if
NOT supported.protected com.google.gwt.event.dom.client.HasAllFocusHandlers getWidgetAsHasAllFocusHandlers()
getWidgetAsHasAllFocusHandlers
in class UiWidgetAdapterGwtWidgetActive<com.google.gwt.user.client.ui.FlowPanel>
widget
as HasAllFocusHandlers
or null
if
NOT supported.public void setTitle(String title)
setTitle
in interface AttributeWriteStringTitle
setTitle
in interface AttributeWriteTitle<String>
title
- is the new title.AttributeReadStringTitle.getTitle()
public void setEnabled(boolean enabled)
enabled
status of this object. If it is disabled, the user can
not interact with the object.setEnabled
in interface AttributeWriteEnabled
enabled
- - if true
the object will be enabled, else the object will be disabled.private void onOpenEvent(com.google.gwt.event.logical.shared.OpenEvent<com.google.gwt.user.client.ui.TreeItem> event)
event
- is the OpenEvent
.public com.google.gwt.user.client.ui.Tree getGwtTree()
Tree
.public com.google.gwt.user.client.ui.ScrollPanel getScrollPanel()
ScrollPanel
containing the tree
.protected com.google.gwt.dom.client.Element getSizeElement()
getSizeElement
in class UiWidgetAdapterGwt<com.google.gwt.user.client.ui.FlowPanel>
Element
used by UiWidgetAdapterGwt.getLength(LengthProperty)
and
UiWidgetAdapterGwt.setLength(LengthProperty, Length)
.public com.google.gwt.user.client.ui.InlineLabel getTitleHeader()
public boolean isTitleVisible()
title
of this object is
visible
. For Accessibility
reasons you should always
set the title
of a titled object. However in specific
cases you want to save space on the screen and may not require the title to be displayed for seeing
users. Then you can hide the title while it is still recognized by assistive technology such as screen
readers.isTitleVisible
in interface AttributeReadTitleVisible
true
if visible, false
if hidden.public void setTitleVisible(boolean titleVisible)
titleVisible flag
of this object.setTitleVisible
in interface AttributeWriteTitleVisible
titleVisible
- is the new value for AttributeReadTitleVisible.isTitleVisible()
.public void setSummary(String summary)
summary
of this object.setSummary
in interface AttributeWriteSummary
summary
- is the new summary
to set.public String getSummary()
getSummary
in interface AttributeReadSummary
protected AbstractUiWidgetTree<?,NODE> getUiWidgetTyped()
AbstractUiWidgetAdapter.getUiWidget()
and want to perform the cast only in a single place. If you would override
AbstractUiWidgetAdapter.getUiWidget()
to add the cast and do that multiple times across the inheritance hierarchy this
would cause multiple/unnecessary casts. Casting is required as we already declare enough generics for
widget adapters and also want to keep the code more flexible.getUiWidgetTyped
in class AbstractUiWidgetAdapter<com.google.gwt.user.client.ui.FlowPanel>
UiWidget
potentially specifically typed.protected com.google.gwt.user.client.ui.FlowPanel createToplevelWidget()
underlying widget
. createToplevelWidget
in class AbstractUiWidgetAdapter<com.google.gwt.user.client.ui.FlowPanel>
underlying widget
.Copyright © 2001–2016 mmm-Team. All rights reserved.