Example usage for com.google.gwt.user.client.ui HasTreeItems addItem

List of usage examples for com.google.gwt.user.client.ui HasTreeItems addItem

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui HasTreeItems addItem.

Prototype

TreeItem addItem(Widget widget);

Source Link

Document

Adds a new tree item containing the specified widget.

Usage

From source file:org.dashbuilder.client.gallery.GalleryTreeViewImpl.java

License:Apache License

private void populateNavigationTree(List<GalleryTreeNode> nodes, HasTreeItems items) {
    if (nodes == null)
        return;/*from  ww w .j a  v a2s .c om*/
    for (GalleryTreeNode node : nodes) {
        TreeItem ti = new TreeItem();
        ti.setText(node.getName());
        ti.setUserObject(node);
        ti.getElement().getStyle().setCursor(Style.Cursor.POINTER);
        items.addItem(ti);
        populateNavigationTree(node.getChildren(), ti);
    }
}