Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.Tree


    AbstractImagePrototype treeClosed();
  }
 
  public void onModuleLoad() {
    TreeImages images = (TreeImages)GWT.create(MyTreeImages.class);
    Tree tree = new Tree(images);
    RootPanel.get().add(tree);
  }
View Full Code Here


      throw new IllegalArgumentException("No focusable children to focus on");
    }
  }

  public static Tree createTree() {
    Tree tree = new Tree();
    TreeItem a = new TreeItem("a");
    TreeItem b = new TreeItem(
        "b, though this is a very, very long text field in order to trigger text wrapping bugs, if there are any such bugs currently in the tree.");
    TreeItem ba = new TreeItem("b.a");
    TreeItem bb = new TreeItem("b.b");
    TreeItem bba = new TreeItem("b.b.a");
    TreeItem bc = new TreeItem("b.c");
    TreeItem c = new TreeItem("c");
    TreeItem d = new TreeItem(new RadioButton("myradio",
        "I should line up nicely"));
    TreeItem e = new TreeItem(new CheckBox("I should line up nicely"));
    TreeItem f = new TreeItem(new CheckBox("I should also line up nicely"));
    f.addItem(new CheckBox("me to"));
    SimplePanel panel = new SimplePanel();
    panel.setWidget(new Label("There should not be any space above me"));
    TreeItem g = new TreeItem(panel);

    tree.setSelectedItem(b);
    tree.addItem(a);
    tree.addItem(b);
    tree.addItem(c);
    tree.addItem(d);
    tree.addItem(e);
    tree.addItem(f);
    tree.addItem(g);
    b.addItem(ba);
    b.addItem(bb);
    bb.addItem(bba);
    b.addItem(bc);

    // Focus checks
    DelegatingFocusPanel focus = new DelegatingFocusPanel();
    focus.add(new Label("first check box should have focus "));
    focus.add(new SimpleCheckBox());
    focus.add(new SimpleCheckBox());

    final DelegatingFocusPanel focus2 = new DelegatingFocusPanel();
    focus2.add(new Label("second check box should have focus "));
    focus2.add(new SimpleCheckBox());
    focus2.add(new SimpleCheckBox());

    TreeItem customFocus = new TreeItem(focus2) {
      @Override
      public Focusable getFocusable() {
        return (Focusable) focus2.getWidget(2);
      }
    };
    tree.addItem(focus);
    tree.addItem(customFocus);
    return tree;
  }
View Full Code Here

public class VisualsForTreeEvents extends AbstractIssue {

  @Override
  public Widget createIssue() {
    VerticalPanel p = new VerticalPanel();
    Tree t = VisualsForTree.createTree();
    p.add(t);
    EventReporter<Object, TreeItem> handler = new EventReporter<Object, TreeItem>(
        p);
    t.addKeyboardListener(handler);
    t.addMouseListener(handler);

    t.addSelectionHandler(new SelectionHandler<TreeItem>() {
      public void onSelection(SelectionEvent<TreeItem> event) {
        Window.setTitle("select " + prettyPrint(event.getSelectedItem()));
      }
    });

    t.addCloseHandler(new CloseHandler<TreeItem>() {

      public void onClose(CloseEvent<TreeItem> event) {
        Window.setTitle("close " + prettyPrint(event.getTarget()));
      }

    });

    t.addOpenHandler(new OpenHandler<TreeItem>() {

      public void onOpen(OpenEvent<TreeItem> event) {
        Window.setTitle("open " + prettyPrint(event.getTarget()));
      }
View Full Code Here

public class Issue1245 extends AbstractIssue {
  Tree t = null;

  @Override
  public Widget createIssue() {
    t = new Tree();
    t.addItem("a").addItem("a.a");
    t.addItem("b");
    t.addItem("c").addItem("c.a");
    return t;
  }
View Full Code Here

*/
public class Issue2338 extends AbstractIssue {

  @Override
  public Widget createIssue() {
    Tree tree = new Tree();
    tree.setAnimationEnabled(true);
    TreeItem root = tree.addItem("Root");
    for (int i = 0; i < 5; i++) {
      root.addItem("Item " + i);
    }
    return tree;
  }
View Full Code Here

*/
public class Issue2553 extends AbstractIssue {

  @Override
  public Widget createIssue() {
    Tree tree = new Tree();
    tree.addItem("This is a long text displayed in a tree item");
    tree.addItem("This is a long text displayed in a tree item and it's longer than the others");
    tree.addItem("This is a long text displayed in a tree item");
    return tree;
  }
View Full Code Here

public class VisualsForCustomButtons extends AbstractIssue {

  @Override
  public Widget createIssue() {
    SimpleLayout l = new SimpleLayout();
    Tree t = new Tree();
    PushButton a = new PushButton("Simple-dum");
    t.add(a);
    PushButton a2 = new PushButton("Simple-dee");
    t.add(a2);
    PushButton aUp = new PushButton("A-up");
    aUp.getDownFace().setHTML("A-down");
    t.add(aUp);

    ToggleButton b = new ToggleButton("B");
    t.add(b);
    l.add(t);
    l.nextRow();
    EventReporter<Object, Object> handler = new EventReporter<Object, Object>();
    l.addFooter(handler);
    handler.addClickHandler(a, l);
View Full Code Here

*/
public class Issue2290 extends AbstractIssue {

  @Override
  public Widget createIssue() {
    Tree tree = new Tree();
    TreeItem root = tree.addItem("Root Item");
    root.addItem("Item1");
    root.addItem("Item2");
    root.addItem("Item3");
    root.addItem("Item4");

    root.setState(true);
    tree.setSelectedItem(root);

    return tree;
  }
View Full Code Here

        int size = valueMapArray.length();
        panel.add(new HTML("<div>************************</di>"
                + "<h4>Layouts analyzed on server, total top level problems: "
                + size + " </h4>"));
        if (size > 0) {
            Tree tree = new Tree();

            // Position relative does not work here in IE7
            DOM.setStyleAttribute(tree.getElement(), "position", "");

            TreeItem root = new TreeItem("Root problems");
            for (int i = 0; i < size; i++) {
                printLayoutError(valueMapArray.get(i), root, ac);
            }
            panel.add(tree);
            tree.addItem(root);

        }
        if (zeroHeightComponents.size() > 0 || zeroWidthComponents.size() > 0) {
            panel.add(new HTML("<h4> Client side notifications</h4>"
                    + " <em>Following relative sized components where "
View Full Code Here

    NamedFrame p = widgetUi.myNamedFrame;
    assertNotNull("NamedFrame exists", p);
  }

  public void testTree() {
    Tree tree = widgetUi.myTree;
    TreeItem complexItem = widgetUi.myTreeItemC;
    // top level items
    assertEquals(3, tree.getItemCount());
    assertSame(widgetUi.myTreeItemA, tree.getItem(0));
    assertSame(widgetUi.myTreeWidgetB, tree.getItem(1).getWidget());
    assertSame(complexItem, tree.getItem(2));
    // complex item
    assertSame(2, complexItem.getChildCount());
    assertSame(widgetUi.myTreeItemCA, complexItem.getChild(0));
    assertSame(widgetUi.myTreeWidgetCB, complexItem.getChild(1).getWidget());
  }
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.Tree

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.