Package com.google.gwt.widgetideas.client

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


    tree = new FastTree();
    popup.setWidget(tree);
  }

  public FastTreeItem getChild(HasFastTreeItems parent, String childName) {
    FastTreeItem key = null;
    for (int j = 0; j < parent.getChildCount(); j++) {
      FastTreeItem child = parent.getChild(j);
      if (child.getText().equals(childName)) {
        key = child;
        break;
      }
    }
    if (key == null) {
View Full Code Here


      for (int i = 0; i < args.length; i++) {
        parent = getChild(parent, args[i]);
      }
    }
    FastTreeItem target = new FastTreeItem(message);
    parent.addItem(target);
    target.addStyleName(level.getName().toLowerCase());
    if (e != null) {
      target.addItem(DivLogHandler.formatMessage("thrown", level, e));
    }

    tree.setSelectedItem(target);
    tree.ensureSelectedItemVisible();
    if (autoShow) {
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

    return t;
  }

  private Widget treeWithVarietyWidgets() {
    FastTree t = new FastTree();
    FastTreeItem item = t.addItem("Text");
    item.addItem(new TextBox());
    ListBox lb = new ListBox();
    for (int i = 0; i < 100; i++) {
      lb.addItem(i + "");
    }
    item.addItem(lb);
    item.addItem(new TextArea());

    return t;
  }
View Full Code Here

    b.addKeyboardListener(new KeyboardListener() {

      public void onKeyDown(Widget sender, char keyCode, int modifiers) {
        if (keyCode == KEY_ENTER) {
          String value = b.getText().trim();
          FastTreeItem chosen = treeItems.get(value);
          if (chosen == null) {
            Window.alert("No such tree item exists");
          }
          tree.setSelectedItem(chosen);
          tree.ensureSelectedItemVisible();
        }
      }

      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
      }

      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
      }
    });
    ScrollPanel scroller = new ScrollPanel();

    for (int i = 0; i < 10; i++) {
      FastTreeItem item = tree.addItem("" + i);
      treeItems.put("" + i, item);
      for (int j = 0; j < 5; j++) {
        String value = "" + i + "." + j;
        FastTreeItem subItem = item.addItem(value);
        treeItems.put(value, subItem);
        for (int k = 0; k < 2; k++) {
          String newValue = i + "." + j + "." + k;
          treeItems.put(newValue, subItem.addItem(newValue));
        }
      }
    }
    scroller.setWidget(tree);
    scroller.setHeight("200px");
View Full Code Here

    RootPanel.get().add(new HTML(s));
  }

  public void store() {
    FastTree t = new FastTree();
    FastTreeItem camping = t.addItem("Camping Gear");
    camping.addItem("Camping tents");
    FastTreeItem cooking = camping.addItem("Cooking gear");
    camping.setState(true);

    t.setSelectedItem(cooking);

    FastTreeItem ap = t.addItem("Apparel");
    ap.addItem("Jackets");
    ap.addItem("Shirts");
    t.addItem("Footwear").becomeInteriorNode();
    t.addItem("Coolers");
    RootPanel.get().add(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.