Class TreeItem

java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.TreeItem
All Implemented Interfaces:
HasSafeHtml, HasHTML, HasText, HasTreeItems, HasVisibility, IsTreeItem

public class TreeItem extends UIObject implements IsTreeItem, HasTreeItems, HasHTML, HasSafeHtml
An item that can be contained within a Tree. Each tree item is assigned a unique DOM id in order to support ARIA. See Accessibility for more information.

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);
  }
}