Package com.google.gwt.user.client.ui
Class Tree
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Tree
- All Implemented Interfaces:
HasAllFocusHandlers,HasAllKeyHandlers,HasAllMouseHandlers,HasBlurHandlers,HasFocusHandlers,HasKeyDownHandlers,HasKeyPressHandlers,HasKeyUpHandlers,HasMouseDownHandlers,HasMouseMoveHandlers,HasMouseOutHandlers,HasMouseOverHandlers,HasMouseUpHandlers,HasMouseWheelHandlers,HasAttachHandlers,HasCloseHandlers<TreeItem>,HasOpenHandlers<TreeItem>,HasSelectionHandlers<TreeItem>,HasHandlers,EventListener,Focusable,HasAnimation,HasFocus,HasTreeItems,HasTreeItems.ForIsWidget,HasVisibility,HasWidgets,HasWidgets.ForIsWidget,IsWidget,SourcesFocusEvents,SourcesKeyboardEvents,SourcesMouseEvents,SourcesTreeEvents,Iterable<Widget>
public class Tree
extends Widget
implements HasTreeItems.ForIsWidget, HasWidgets.ForIsWidget, SourcesTreeEvents, HasFocus, HasAnimation, HasAllKeyHandlers, HasAllFocusHandlers, HasSelectionHandlers<TreeItem>, HasOpenHandlers<TreeItem>, HasCloseHandlers<TreeItem>, SourcesMouseEvents, HasAllMouseHandlers
A standard hierarchical tree widget. The tree contains a hierarchy of
TreeItems that the user can
open, close, and select.
CSS Style Rules
- .gwt-Tree
- the tree itself
- .gwt-Tree .gwt-TreeItem
- a tree item
- .gwt-Tree .gwt-TreeItem-selected
- a selected tree item
Example
public class TreeExample implements EntryPoint {
@Override
public void onModuleLoad() {
// Create a tree with a few items in it.
TreeItem root = new TreeItem();
root.setText("root");
root.addTextItem("item0");
root.addTextItem("item1");
root.addTextItem("item2");
// Add a CheckBox to the tree
TreeItem item = new TreeItem(new CheckBox("item3"));
root.addItem(item);
Tree t = new Tree();
t.addItem(root);
// Add it to the root panel.
RootPanel.get().add(t);
}
}
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classThere are several ways of configuring images for the Tree widget due to deprecated APIs.static interfaceA ClientBundle that provides images for this widget.Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasTreeItems
HasTreeItems.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
HasWidgets.ForIsWidget -
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.Widget
eventsToSinkFields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX, MISSING_ELEMENT_ERROR, SETELEMENT_TWICE_ERROR -
Constructor Summary
ConstructorsConstructorDescriptionTree()Constructs an empty tree.Tree(Tree.Resources resources) Constructs a tree that uses the specified ClientBundle for images.Tree(Tree.Resources resources, boolean useLeafImages) Constructs a tree that uses the specified ClientBundle for images.Tree(TreeImages images) Deprecated.Tree(TreeImages images, boolean useLeafImages) Deprecated.replaced byTree(Resources, boolean) -
Method Summary
Modifier and TypeMethodDescriptionvoidOverloaded version for IsWidget.voidAdds the widget as a root tree item.addBlurHandler(BlurHandler handler) Adds aBlurEventhandler.addCloseHandler(CloseHandler<TreeItem> handler) Adds aCloseEventhandler.addFocusHandler(FocusHandler handler) Adds aFocusEventhandler.voidaddFocusListener(FocusListener listener) Deprecated.Adds a simple tree item containing the specified html.voidaddItem(IsTreeItem isItem) Adds an item to the root level of this tree.Overloaded version for IsWidget.voidAdds an item to the root level of this tree.Adds a new tree item containing the specified widget.voidaddKeyboardListener(KeyboardListener listener) addKeyDownHandler(KeyDownHandler handler) Adds aKeyDownEventhandler.addKeyPressHandler(KeyPressHandler handler) Adds aKeyPressEventhandler.addKeyUpHandler(KeyUpHandler handler) Adds aKeyUpEventhandler.addMouseDownHandler(MouseDownHandler handler) Adds aMouseDownEventhandler.voidaddMouseListener(MouseListener listener) Deprecated.UseaddMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler),addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler),addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler)andaddMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)insteadaddMouseMoveHandler(MouseMoveHandler handler) Adds aMouseMoveEventhandler.addMouseOutHandler(MouseOutHandler handler) Adds aMouseOutEventhandler.addMouseOverHandler(MouseOverHandler handler) Adds aMouseOverEventhandler.addMouseUpHandler(MouseUpHandler handler) Adds aMouseUpEventhandler.addMouseWheelHandler(MouseWheelHandler handler) Adds aMouseWheelEventhandler.final HandlerRegistrationaddOpenHandler(OpenHandler<TreeItem> handler) Adds anOpenEventhandler.addSelectionHandler(SelectionHandler<TreeItem> handler) Adds aSelectionEventhandler.addTextItem(String itemText) Adds a simple tree item containing the specified text.voidaddTreeListener(TreeListener listener) Deprecated.UseaddSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<com.google.gwt.user.client.ui.TreeItem>),addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<com.google.gwt.user.client.ui.TreeItem>), andaddCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.TreeItem>)instead(package private) voidvoidclear()Clears all tree items from the current tree.protected voidIf a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onAttach()for each of its child widgets.protected voidIf a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onDetach()for each of its child widgets.voidEnsures that the currently-selected item is visible, opening its parents and scrolling the tree as necessary.(package private) voidfireStateChanged(TreeItem item, boolean open) (package private) Tree.ImageAdaptergetItem(int index) Gets the top-level tree item at the specified index.intGets the number of items contained at the root of this tree.Gets the currently selected item.intGets the widget's position in the tab index.insertItem(int beforeIndex, SafeHtml itemHtml) Inserts a child tree item at the specified index containing the specified html.voidinsertItem(int beforeIndex, TreeItem item) Inserts an item into the root level of this tree.insertItem(int beforeIndex, Widget widget) Inserts a child tree item at the specified index containing the specified widget.insertTextItem(int beforeIndex, String itemText) Inserts a child tree item at the specified index containing the specified text.booleanReturns true if animations are enabled, false if not.protected booleanisKeyboardNavigationEnabled(TreeItem currentItem) Indicates if keyboard navigation is enabled for the Tree and for a given TreeItem.booleanDetermines whether selecting a tree item will scroll it into view.iterator()Gets an iterator for the contained widgets.(package private) voidmaybeUpdateSelection(TreeItem itemThatChangedState, boolean isItemOpening) voidonBrowserEvent(Event event) Fired whenever a browser event is received.protected voidonEnsureDebugId(String baseID) Affected Elements: -root = The rootTreeItem.protected voidonLoad()This method is called immediately after a widget becomes attached to the browser's document.(package private) voidbooleanOverloaded version for IsWidget.booleanRemoves a child widget.voidremoveFocusListener(FocusListener listener) Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned byaddFocusHandler(com.google.gwt.event.dom.client.FocusHandler)insteadvoidremoveItem(IsTreeItem isItem) Removes an item from the root level of this tree.voidremoveItem(TreeItem item) Removes an item from the root level of this tree.voidRemoves all items from the root level of this tree.voidremoveKeyboardListener(KeyboardListener listener) Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadvoidremoveMouseListener(MouseListener listener) Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadvoidremoveTreeListener(TreeListener listener) Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadvoidsetAccessKey(char key) Sets the widget's 'access key'.voidsetAnimationEnabled(boolean enable) Enable or disable animations.voidsetFocus(boolean focus) Explicitly focus/unfocus this widget.voidsetScrollOnSelectEnabled(boolean enable) Enable or disable scrolling a tree item into view when it is selected.voidsetSelectedItem(TreeItem item) Selects a specified item.voidsetSelectedItem(TreeItem item, boolean fireEvents) Selects a specified item.voidsetTabIndex(int index) Sets the widget's position in the tab index.(package private) static boolean(package private) voidshowClosedImage(TreeItem treeItem) Called only fromTreeItem: Shows the closed image on that tree item.(package private) voidshowLeafImage(TreeItem treeItem) Called only fromTreeItem: Shows the leaf image on a tree item.(package private) voidshowOpenImage(TreeItem treeItem) Called only fromTreeItem: Shows the open image on a tree item.Iterator of tree items.Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, ensureHandlers, fireEvent, getHandlerCount, getHandlerManager, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, onUnload, removeFromParent, replaceElement, setLayoutData, setParent, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
Tree
public Tree()Constructs an empty tree. -
Tree
Constructs a tree that uses the specified ClientBundle for images.- Parameters:
resources- a bundle that provides tree specific images
-
Tree
Constructs a tree that uses the specified ClientBundle for images. If this tree does not use leaf images, the width of the Resources's leaf image will control the leaf indent.- Parameters:
resources- a bundle that provides tree specific imagesuseLeafImages- use leaf images from bundle
-
Tree
Deprecated.replaced byTree(Resources)Constructs a tree that uses the specified image bundle for images.- Parameters:
images- a bundle that provides tree specific images
-
Tree
Deprecated.replaced byTree(Resources, boolean)Constructs a tree that uses the specified image bundle for images. If this tree does not use leaf images, the width of the TreeImage's leaf image will control the leaf indent.- Parameters:
images- a bundle that provides tree specific imagesuseLeafImages- use leaf images from bundle
-
-
Method Details
-
shouldTreeDelegateFocusToElement
-
add
Adds the widget as a root tree item.- Specified by:
addin interfaceHasWidgets- Parameters:
widget- widget to add.- See Also:
-
add
Overloaded version for IsWidget.- Specified by:
addin interfaceHasWidgets.ForIsWidget- See Also:
-
addBlurHandler
Description copied from interface:HasBlurHandlersAdds aBlurEventhandler.- Specified by:
addBlurHandlerin interfaceHasBlurHandlers- Parameters:
handler- the blur handler- Returns:
HandlerRegistrationused to remove this handler
-
addFocusHandler
Description copied from interface:HasFocusHandlersAdds aFocusEventhandler.- Specified by:
addFocusHandlerin interfaceHasFocusHandlers- Parameters:
handler- the focus handler- Returns:
HandlerRegistrationused to remove this handler
-
addFocusListener
Deprecated.Description copied from interface:SourcesFocusEventsAdds a listener interface to receive focus events.- Specified by:
addFocusListenerin interfaceSourcesFocusEvents- Parameters:
listener- the listener interface to add
-
addItem
Adds an item to the root level of this tree.- Specified by:
addItemin interfaceHasTreeItems- Parameters:
item- the item to be added
-
addItem
Adds an item to the root level of this tree.- Specified by:
addItemin interfaceHasTreeItems- Parameters:
isItem- the wrapper of item to be added
-
addItem
Adds a new tree item containing the specified widget.- Specified by:
addItemin interfaceHasTreeItems- Parameters:
widget- the widget to be added- Returns:
- the new item
-
addItem
Overloaded version for IsWidget.- Specified by:
addItemin interfaceHasTreeItems.ForIsWidget- See Also:
-
addKeyboardListener
Deprecated.Description copied from interface:SourcesKeyboardEventsAdds a listener interface to receive keyboard events.- Specified by:
addKeyboardListenerin interfaceSourcesKeyboardEvents- Parameters:
listener- the listener interface to add
-
addKeyDownHandler
Description copied from interface:HasKeyDownHandlersAdds aKeyDownEventhandler.- Specified by:
addKeyDownHandlerin interfaceHasKeyDownHandlers- Parameters:
handler- the key down handler- Returns:
HandlerRegistrationused to remove this handler
-
addKeyPressHandler
Description copied from interface:HasKeyPressHandlersAdds aKeyPressEventhandler.- Specified by:
addKeyPressHandlerin interfaceHasKeyPressHandlers- Parameters:
handler- the key press handler- Returns:
HandlerRegistrationused to remove this handler
-
addKeyUpHandler
Description copied from interface:HasKeyUpHandlersAdds aKeyUpEventhandler.- Specified by:
addKeyUpHandlerin interfaceHasKeyUpHandlers- Parameters:
handler- the key up handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseDownHandler
Description copied from interface:HasMouseDownHandlersAdds aMouseDownEventhandler.- Specified by:
addMouseDownHandlerin interfaceHasMouseDownHandlers- Parameters:
handler- the mouse down handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseListener
Deprecated.UseaddMouseOverHandler(com.google.gwt.event.dom.client.MouseOverHandler)addMouseMoveHandler(com.google.gwt.event.dom.client.MouseMoveHandler),addMouseDownHandler(com.google.gwt.event.dom.client.MouseDownHandler),addMouseUpHandler(com.google.gwt.event.dom.client.MouseUpHandler)andaddMouseOutHandler(com.google.gwt.event.dom.client.MouseOutHandler)insteadDescription copied from interface:SourcesMouseEventsAdds a listener interface to receive mouse events.- Specified by:
addMouseListenerin interfaceSourcesMouseEvents- Parameters:
listener- the listener interface to add
-
addMouseMoveHandler
Description copied from interface:HasMouseMoveHandlersAdds aMouseMoveEventhandler.- Specified by:
addMouseMoveHandlerin interfaceHasMouseMoveHandlers- Parameters:
handler- the mouse move handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseOutHandler
Description copied from interface:HasMouseOutHandlersAdds aMouseOutEventhandler.- Specified by:
addMouseOutHandlerin interfaceHasMouseOutHandlers- Parameters:
handler- the mouse out handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseOverHandler
Description copied from interface:HasMouseOverHandlersAdds aMouseOverEventhandler.- Specified by:
addMouseOverHandlerin interfaceHasMouseOverHandlers- Parameters:
handler- the mouse over handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseUpHandler
Description copied from interface:HasMouseUpHandlersAdds aMouseUpEventhandler.- Specified by:
addMouseUpHandlerin interfaceHasMouseUpHandlers- Parameters:
handler- the mouse up handler- Returns:
HandlerRegistrationused to remove this handler
-
addMouseWheelHandler
Description copied from interface:HasMouseWheelHandlersAdds aMouseWheelEventhandler.- Specified by:
addMouseWheelHandlerin interfaceHasMouseWheelHandlers- Parameters:
handler- the mouse wheel handler- Returns:
HandlerRegistrationused to remove this handler
-
addTextItem
Adds a simple tree item containing the specified text.- Specified by:
addTextItemin interfaceHasTreeItems- Parameters:
itemText- the text of the item to be added- Returns:
- the item that was added
-
addTreeListener
Deprecated.UseaddSelectionHandler(com.google.gwt.event.logical.shared.SelectionHandler<com.google.gwt.user.client.ui.TreeItem>),addOpenHandler(com.google.gwt.event.logical.shared.OpenHandler<com.google.gwt.user.client.ui.TreeItem>), andaddCloseHandler(com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.TreeItem>)insteadDescription copied from interface:SourcesTreeEventsAdds a listener interface to receive tree events.- Specified by:
addTreeListenerin interfaceSourcesTreeEvents- Parameters:
listener- the listener interface to add
-
clear
public void clear()Clears all tree items from the current tree.- Specified by:
clearin interfaceHasWidgets
-
ensureSelectedItemVisible
public void ensureSelectedItemVisible()Ensures that the currently-selected item is visible, opening its parents and scrolling the tree as necessary. -
getItem
Gets the top-level tree item at the specified index.- Parameters:
index- the index to be retrieved- Returns:
- the item at that index
-
getItemCount
public int getItemCount()Gets the number of items contained at the root of this tree.- Returns:
- this tree's item count
-
getSelectedItem
Gets the currently selected item.- Returns:
- the selected item
-
getTabIndex
public int getTabIndex()Description copied from interface:FocusableGets the widget's position in the tab index.- Specified by:
getTabIndexin interfaceFocusable- Returns:
- the widget's tab index
-
insertItem
Inserts an item into the root level of this tree.- Parameters:
beforeIndex- the index where the item will be inserteditem- the item to be added- Throws:
IndexOutOfBoundsException- if the index is out of range
-
insertItem
Inserts a child tree item at the specified index containing the specified widget.- Parameters:
beforeIndex- the index where the item will be insertedwidget- the widget to be added- Returns:
- the item that was added
- Throws:
IndexOutOfBoundsException- if the index is out of range
-
insertTextItem
Inserts a child tree item at the specified index containing the specified text.- Parameters:
beforeIndex- the index where the item will be inserteditemText- the text of the item to be added- Returns:
- the item that was added
- Throws:
IndexOutOfBoundsException- if the index is out of range
-
isAnimationEnabled
public boolean isAnimationEnabled()Description copied from interface:HasAnimationReturns true if animations are enabled, false if not.- Specified by:
isAnimationEnabledin interfaceHasAnimation
-
isScrollOnSelectEnabled
public boolean isScrollOnSelectEnabled()Determines whether selecting a tree item will scroll it into view. -
iterator
Description copied from interface:HasWidgetsGets an iterator for the contained widgets. This iterator is required to implementIterator.remove().- Specified by:
iteratorin interfaceHasWidgets- Specified by:
iteratorin interfaceIterable<Widget>
-
onBrowserEvent
Description copied from interface:EventListenerFired whenever a browser event is received.- Specified by:
onBrowserEventin interfaceEventListener- Overrides:
onBrowserEventin classWidget- Parameters:
event- the event received
-
remove
Description copied from interface:HasWidgetsRemoves a child widget.- Specified by:
removein interfaceHasWidgets- Parameters:
w- the widget to be removed- Returns:
trueif the widget was present
-
remove
Overloaded version for IsWidget.- Specified by:
removein interfaceHasWidgets.ForIsWidget- See Also:
-
removeFocusListener
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned byaddFocusHandler(com.google.gwt.event.dom.client.FocusHandler)insteadDescription copied from interface:SourcesFocusEventsRemoves a previously added listener interface.- Specified by:
removeFocusListenerin interfaceSourcesFocusEvents- Parameters:
listener- the listener interface to remove
-
removeItem
Removes an item from the root level of this tree.- Specified by:
removeItemin interfaceHasTreeItems- Parameters:
item- the item to be removed
-
removeItem
Removes an item from the root level of this tree.- Specified by:
removeItemin interfaceHasTreeItems- Parameters:
isItem- the wrapper of item to be removed
-
removeItems
public void removeItems()Removes all items from the root level of this tree.- Specified by:
removeItemsin interfaceHasTreeItems
-
removeKeyboardListener
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadDescription copied from interface:SourcesKeyboardEventsRemoves a previously added listener interface.- Specified by:
removeKeyboardListenerin interfaceSourcesKeyboardEvents- Parameters:
listener- the listener interface to remove
-
removeMouseListener
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadDescription copied from interface:SourcesMouseEventsRemoves a previously added listener interface.- Specified by:
removeMouseListenerin interfaceSourcesMouseEvents- Parameters:
listener- the listener interface to remove
-
removeTreeListener
Deprecated.Use theHandlerRegistration.removeHandler()method on the object returned by an add*Handler method insteadDescription copied from interface:SourcesTreeEventsRemoves a previously added listener interface.- Specified by:
removeTreeListenerin interfaceSourcesTreeEvents- Parameters:
listener- the listener interface to remove
-
setAccessKey
public void setAccessKey(char key) Description copied from interface:FocusableSets the widget's 'access key'. This key is used (in conjunction with a browser-specific modifier key) to automatically focus the widget.- Specified by:
setAccessKeyin interfaceFocusable- Parameters:
key- the widget's access key
-
setAnimationEnabled
public void setAnimationEnabled(boolean enable) Description copied from interface:HasAnimationEnable or disable animations.- Specified by:
setAnimationEnabledin interfaceHasAnimation- Parameters:
enable- true to enable, false to disable
-
setFocus
public void setFocus(boolean focus) Description copied from interface:FocusableExplicitly focus/unfocus this widget. Only one widget can have focus at a time, and the widget that does will receive all keyboard events. NOTE: Most browsers fire FocusEvents asynchronously. Especially within GWT tests, you'll need to make your test asynchronous to properly do verifications. SeeGWTTestCase#delayTestFinishfor more information on how to do this. -
setScrollOnSelectEnabled
public void setScrollOnSelectEnabled(boolean enable) Enable or disable scrolling a tree item into view when it is selected. Scrolling into view is enabled by default. -
setSelectedItem
Selects a specified item.- Parameters:
item- the item to be selected, ornullto deselect all items
-
setSelectedItem
Selects a specified item.- Parameters:
item- the item to be selected, ornullto deselect all itemsfireEvents-trueto allow selection events to be fired
-
setTabIndex
public void setTabIndex(int index) Description copied from interface:FocusableSets the widget's position in the tab index. If more than one widget has the same tab index, each such widget will receive focus in an arbitrary order. Setting the tab index to-1will cause this widget to be removed from the tab order.- Specified by:
setTabIndexin interfaceFocusable- Parameters:
index- the widget's tab index
-
treeItemIterator
Iterator of tree items.- Returns:
- the iterator
-
doAttachChildren
protected void doAttachChildren()Description copied from class:WidgetIf a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onAttach()for each of its child widgets.- Overrides:
doAttachChildrenin classWidget- See Also:
-
doDetachChildren
protected void doDetachChildren()Description copied from class:WidgetIf a widget contains one or more child widgets that are not in the logical widget hierarchy (the child is physically connected only on the DOM level), it must override this method and callWidget.onDetach()for each of its child widgets.- Overrides:
doDetachChildrenin classWidget- See Also:
-
onEnsureDebugId
Affected Elements:- -root = The root
TreeItem.
- Overrides:
onEnsureDebugIdin classUIObject- Parameters:
baseID- the base ID used by the main element- See Also:
- -root = The root
-
onLoad
protected void onLoad()Description copied from class:WidgetThis method is called immediately after a widget becomes attached to the browser's document. -
adopt
-
fireStateChanged
-
getChildWidgets
-
getImages
Tree.ImageAdapter getImages() -
maybeUpdateSelection
-
orphan
-
showClosedImage
Called only fromTreeItem: Shows the closed image on that tree item.- Parameters:
treeItem- the tree item
-
showLeafImage
Called only fromTreeItem: Shows the leaf image on a tree item.- Parameters:
treeItem- the tree item
-
showOpenImage
Called only fromTreeItem: Shows the open image on a tree item.- Parameters:
treeItem- the tree item
-
Tree(Resources)