Package com.google.gwt.widgetideas.client

Examples of com.google.gwt.widgetideas.client.FastTreeItem


    RootPanel.get().add(t);
  }

  protected Widget basicTree() {
    FastTree t = new FastTree();
    FastTreeItem a = t.addItem("A root tree item");
    a.addItem("A child");
    FastTreeItem aXb = a.addItem("Another child");
    aXb.addItem("a grand child");
    FastTreeItem widgetBranch = a.addItem(new CheckBox("A checkbox child"));
    FastTreeItem textBoxParent = widgetBranch.addItem("A TextBox parent");
    textBoxParent.addItem(new TextBox());
    textBoxParent.addItem("and another one...");
    textBoxParent.addItem(new TextArea());

    ListBox lb = new ListBox();
    for (int i = 0; i < 100; i++) {
      lb.addItem(i + "");
    }
View Full Code Here


  }

  private void lazyCreateChild(final HasFastTreeItems parent, final int index,
      final int children) {

    FastTreeItem item = new FastTreeItem("child" + index + " (" + children
        + " children)") {
      public void ensureChildren() {
        for (int i = 0; i < children; i++) {
          lazyCreateChild(this, i, children + (i * 10));
        }
      }
    };
    item.becomeInteriorNode();
    parent.addItem(item);
  }
View Full Code Here

    parent.addItem(item);
  }

  private FastTreeItem profileAdd(FastTreeItem parent, TreeType type) {
    if (type == TreeType.TEXT) {
      FastTreeItem text = new FastTreeItem();
      text.setText("item");
      parent.addItem(text);
      return text;
    } else if (type == TreeType.HTML) {
      FastTreeItem item = new FastTreeItem("<h1>html</h1>");
      parent.addItem(item);
      return item;
    } else if (type == TreeType.CHECKBOX) {
      return parent.addItem(new CheckBox("myBox"));
    } else {
View Full Code Here

    }
  }

  private void profileCreateTree(FastTree t, int numBranches, int numNodes,
      TreeType type) {
    FastTreeItem root = t.addItem("root");
    ArrayList front = new ArrayList();
    front.add(profileAdd(root, type));
    int count = 0;
    while (true) {
      ArrayList newFront = new ArrayList();
View Full Code Here

  private void verboseTreeItem(HasFastTreeItems parent, int children) {
    for (int i = 0; i < children; i++) {
      final int index = i;

      FastTreeItem item = new ListeningFastTreeItem("child " + i) {

        public void beforeClose() {
          Window.alert("Close item" + index);
        }
View Full Code Here

    wrapper.add(contents, "<b>People</b>", true);

    wrapper.add(new Label("None"), "<b>Academics</b>", true);
    navBar.add(wrapper);

    FastTreeItem students = contents.addItem("Students");
    students.addItem("Jill");
    students.addItem("Jack");
    students.addItem("Molly");
    students.addItem("Ms. Muffat");

    FastTreeItem teachers = contents.addItem("Teachers");
    teachers.addItem("Mrs Black");
    teachers.addItem("Mr White");

    FastTreeItem admin = contents.addItem("Administrators");
    admin.addItem("The Soup Nazi");
    admin.addItem("The Grand High Supreme Master Pubba");
    return navBar;
  }
View Full Code Here

  private FastTreeItem add(FastTreeItem parent, String value, TreeType type) {
    if (type == TreeType.TEXT) {
      return parent.addItem(value);
    } else if (type == TreeType.HTML) {
      FastTreeItem item = new FastTreeItem();
      item.setHTML("<a>" + value + "</a>");
      parent.addItem(item);
      return item;
    } else if (type == TreeType.CHECKBOX) {
      return parent.addItem(new CheckBox(value));
    } else {
View Full Code Here

    }
  }

  private Widget focusTree() {
    // Create a tree with a few items in it.
    FastTreeItem root = new FastTreeItem("root");
    root.addItem("item0");
    root.addItem("item1");
    root.addItem("item2");
    root.addItem(new CheckBox("item3"));
    FastTree t = new FastTree();

    // tree2
    FastTreeItem root2 = new FastTreeItem("child root");
    root2.addItem("child item0");
    root2.addItem("child item1");
    root2.addItem("child item2");
    root2.addItem(new CheckBox("child item3"));

    // nest the trees
    root.addItem(root2);
    t.addItem(root);
    t.addFocusListener(new FocusListener() {
View Full Code Here

    return t;
  }

  private void populateTree(FastTree t, int numBranches, int numNodes,
      TreeType type) {
    FastTreeItem root = t.addItem("root");

    ArrayList front = new ArrayList();
    front.add(add(root, "first child", type));
    int count = 0;
    while (true) {
View Full Code Here

    return sp;
  }

  private Widget treeInTree() {
    // Create a tree with a few items in it.
    FastTreeItem root = new FastTreeItem("root");
    root.addItem("item0");
    root.addItem("item1");
    root.addItem("item2");
    root.addItem(new CheckBox("item3"));
    FastTree t = new FastTree();

    // tree2
    FastTreeItem root2 = new FastTreeItem("child root");
    root2.addItem("child item0");
    root2.addItem("child item1");
    root2.addItem("child item2");
    root2.addItem(new CheckBox("child item3"));
    FastTree t2 = new FastTree();

    // nest the trees
    t2.addItem(root2);
    FastTreeItem item = new FastTreeItem(t2);
    root.addItem(item);
    t.addItem(root);

    return t;
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.widgetideas.client.FastTreeItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.