Examples of FastTreeItem


Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

    controlButton.setStylePrimaryName("CollapsibleTitle");

    final FastTree contents = new FastTree();
    navBar.add(contents);

    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

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

    RootPanel.get().add(new FastTreeDemo().createDemo());
  }

  protected Widget basicTree() {
    FastTree t = new FastTree();
    FastTreeItem a = t.addItem("A root tree item");
    a.addItem("A child with different style");
    a.addItem("regular style");
    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());

    // Add an item with basic elements inside of it
    {
      final TextBox textBox = new TextBox();
      Hyperlink link = new Hyperlink("change focus", "blah");
      link.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
          textBox.setFocus(true);
          event.getNativeEvent().stopPropagation();
        }
      });
      VerticalPanel vPanel = new VerticalPanel();
      vPanel.add(link);
      vPanel.add(textBox);
      a.addItem(vPanel);
    }

    // Add a large item
    FastTreeItem hugeParent = a.addItem("I contain a huge item");
    SimplePanel hugePanel = new SimplePanel();
    hugePanel.setPixelSize(1000, 1000);
    hugePanel.getElement().getStyle().setProperty("border", "2px solid blue");
    hugePanel.getElement().getStyle().setPropertyPx("padding", 50);
    Label clickableLabel = new Label("Click Me");
    clickableLabel.setWidth("70px");
    clickableLabel.getElement().getStyle().setProperty("border",
        "1px solid blue");
    clickableLabel.addClickHandler(new ClickHandler() {
      public void onClick(ClickEvent event) {
        Window.alert("You clicked the label");
      }
    });
    hugePanel.setWidget(clickableLabel);
    hugeParent.addItem(hugePanel);

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

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

    return tree;
  }

  private Widget crazyTree() {
    FastTree tree = new FastTree();
    FastTreeItem a = tree.addItem("I am root");
    a.addItem("I am root's child");
    FastTreeItem aXb = a.addItem("Root to become leaf.");
    aXb.addItem("a grand child");
    for (int i = 0; i < 10; i++) {
      aXb.addItem("grand child " + i);
    }
    tree.addOpenHandler(new OpenHandler<FastTreeItem>() {

      public void onOpen(OpenEvent<FastTreeItem> event) {
        if (!event.getTarget().isLeafNode()) {
View Full Code Here

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

  private Widget dynamicTree() {
    FlowPanel container = new FlowPanel();

    // Add Tree
    final FastTree topTree = new FastTree();
    FastTreeItem firstBranch = topTree.addItem("Inbox (3)");
    firstBranch.addItem("Urgent");
    FastTreeItem familyBranch = firstBranch.addItem("Family");
    familyBranch.becomeInteriorNode();
    familyBranch.addItem("Mom");
    familyBranch.addItem("Brosef");
    FastTreeItem secondBranch = firstBranch.addItem("Calendar");
    secondBranch.addItem("Important Meetings");
    container.add(topTree);

    final Button btnAdd = new Button("Add to Family Branch",
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            FastTreeItem selectedItem = topTree.getChild(0).getChild(1);
            Window.alert("Adding new " + selectedItem.getText()
                + " Child Nodes");
            selectedItem.addItem("Dad");
            selectedItem.addItem("Sissef");
          }
        });

    final Button btnKill = new Button("Disown Family Branch",
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            FastTreeItem selectedItem = topTree.getChild(0).getChild(1);
            Window.alert("Disowning " + selectedItem.getText() + " Child Nodes");
            selectedItem.becomeLeaf();
            btnAdd.setVisible(true);
          }
        });

    topTree.addBeforeCloseHandler(new BeforeCloseHandler<FastTreeItem>() {
View Full Code Here

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

    return container;
  }

  private Widget hebrewTree() {
    final FastTree hebrewTree = new FastTree();
    FastTreeItem firstBranch = hebrewTree.addItem("דואר נכנס (3)");
    firstBranch.addItem("דחוף");
    FastTreeItem familyBranch = firstBranch.addItem("משפחה");
    familyBranch.becomeInteriorNode();
    familyBranch.addItem("אמא");
    familyBranch.addItem("אח שלו");
    FastTreeItem secondBranch = firstBranch.addItem("יומן");
    secondBranch.addItem("פגישות חשובות");

    return hebrewTree;
  }
View Full Code Here

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

    return hebrewTree;
  }

  private Widget cancelEventTree() {
    final FastTree cancelEventTree = new FastTree();
    FastTreeItem firstBranch = cancelEventTree.addItem("Select Me!");
    firstBranch.addItem("No! Select Me!");
    firstBranch.addItem("No! Select Me!");
    firstBranch.addItem("No! Select Me!");
    FastTreeItem secondBranch = cancelEventTree.addItem("Don't Select me!");
    secondBranch.addItem("Not me!");
    secondBranch.addItem("Not me!");
    secondBranch.addItem("Not me!");

    cancelEventTree.addBeforeSelectionHandler(new BeforeSelectionHandler<FastTreeItem>() {
      public void onBeforeSelection(BeforeSelectionEvent<FastTreeItem> event) {
        if (!Window.confirm("Continue?")) {
          event.cancel();
View Full Code Here

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

  }

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

    final FastTreeItem item = new FastTreeItem("child" + index + " ("
        + children + " children)");

    item.becomeInteriorNode();
    parent.addItem(item);
  }
View Full Code Here

Examples of com.google.gwt.gen2.complexpanel.client.FastTreeItem

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

      FastTreeItem item = new FastTreeItem();
      item.setText("item " + index);
      parent.addItem(item);
      verboseTreeItem(item, children - (i + 1));
    }
  }
View Full Code Here

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

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

      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
TOP
Copyright © 2018 www.massapi.com. 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.