Package com.google.gwt.gen2.complexpanel.client

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


      Panel contents = createSchoolNavBar();
      FastTree.injectDefaultCss();
      CollapsiblePanel.injectDefaultCss();

      // The panel.
      final CollapsiblePanel panel = new CollapsiblePanel();
      panel.addCollapsedStateHandler(new CollapsedStateHandler() {
        public void onCollapsedState(CollapsedStateEvent e) {
          Window.alert("panel collapsed");
        }
      });

      panel.addExpandedStateHandler(new ExpandedStateHandler() {
        public void onExpandedState(ExpandedStateEvent e) {
          Window.alert("panel expanded");
        }
      });

      String value = Location.getParameter("collapsed");
      if (value != null) {
        value = value.trim();
        if (value.equals("true")) {
          panel.setCollapsedState(true);
        } else if (value.equals("false")) {
          // do nothing, default.
        } else {
          Window.alert("collapsed should not be given " + value
              + " use true or false instead");
        }
      }
      RootPanel.get("collapsible-panel").add(panel);
      panel.add(contents);
      panel.setHeight(Window.getClientHeight() - 1 + "px");
      panel.hookupControlToggle(controlButton);
    } catch (RuntimeException e) {
      if (GWT.isScript()) {
        Log.severe(e.getMessage());
      }
      throw e;
View Full Code Here


      FastTree.injectDefaultCss();
      CollapsiblePanel.injectDefaultCss();

      // The panel.
      final CollapsiblePanel panel = new CollapsiblePanel();
      panel.addCollapsedStateHandler(new CollapsedStateHandler() {
        public void onCollapsedState(CollapsedStateEvent e) {
          Window.alert("panel collapsed");
        }
      });
View Full Code Here

        public void onCollapsedState(CollapsedStateEvent e) {
          Window.alert("panel collapsed");
        }
      });

      panel.addExpandedStateHandler(new ExpandedStateHandler() {
        public void onExpandedState(ExpandedStateEvent e) {
          Window.alert("panel expanded");
        }
      });
View Full Code Here

    navBar.setSize("200px", "");

    navBar.add(controlButton);
    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

    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

    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

    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

  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

    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

    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

TOP

Related Classes of com.google.gwt.gen2.complexpanel.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.