public class TreeExample implements EntryPoint { public void onModuleLoad() { // Create a tree with a few items in it. TreeItem root = new TreeItem("root"); root.addItem("item0"); root.addItem("item1"); root.addItem("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); } }
Tree() | Constructs an empty tree. |
Tree(TreeImages) | Constructs a tree that uses the specified image bundle for images. |
add(Widget) | Adds the widget as a root tree item. |
addFocusListener(FocusListener) | Adds a listener interface to receive mouse events. |
addItem(String) | Adds a simple tree item containing the specified text. |
addItem(TreeItem) | Adds an item to the root level of this tree. |
addItem(Widget) | Adds a new tree item containing the specified widget. |
addKeyboardListener(KeyboardListener) | Adds a listener interface to receive keyboard events. |
addMouseListener(MouseListener) | |
addTreeListener(TreeListener) | Adds a listener interface to receive tree events. |
clear() | Clears all tree items from the current tree. |
doAttachChildren() | If a widget implements HasWidgets, it must override this method and call onAttach() for each of its child widgets. |
doDetachChildren() | If a widget implements HasWidgets, it must override this method and call onDetach() for each of its child widgets. |
ensureSelectedItemVisible() | Ensures that the currently-selected item is visible, opening its parents and scrolling the tree as necessary. |
getImageBase() | Gets this tree's default image package. |
getItem(int) | Gets the top-level tree item at the specified index. |
getItemCount() | Gets the number of items contained at the root of this tree. |
getSelectedItem() | Gets the currently selected item. |
getTabIndex() | Gets the widget's position in the tab index. |
isKeyboardNavigationEnabled(TreeItem) | Indicates if keyboard navigation is enabled for the Tree and for a given TreeItem. |
iterator() | Gets an iterator for the contained widgets. |
onBrowserEvent(Event) | |
onLoad() | This method is called immediately after a widget becomes attached to the browser's document. |
remove(Widget) | Removes a child widget. |
removeFocusListener(FocusListener) | Removes a previously added listener interface. |
removeItem(TreeItem) | Removes an item from the root level of this tree. |
removeItems() | Removes all items from the root level of this tree. |
removeKeyboardListener(KeyboardListener) | Removes a previously added listener interface. |
removeTreeListener(TreeListener) | Removes a previously added listener interface. |
setAccessKey(char) | Sets the widget's 'access key'. |
setFocus(boolean) | Explicitly focus/unfocus this widget. |
setImageBase(String) | Sets the base URL under which this tree will find its default images. |
setSelectedItem(TreeItem) | Selects a specified item. |
setSelectedItem(TreeItem, boolean) | Selects a specified item. |
setTabIndex(int) | Sets the widget's position in the tab index. |
treeItemIterator() | Iterator of tree items. |
true
if the Tree will response to arrow keys by
changing the currently selected itemtrue
if the widget was presentnull
to deselect all
itemsnull
to deselect all
itemstrue
to allow selection events to be fired-1
will cause this widget to
be removed from the tab order.