Package com.vaadin.ui

Examples of com.vaadin.ui.Tree$TreeTransferable


    }

    @Override
    protected void setup() {
        setTheme("runo");
        Tree tree = new Tree();
        tree.setWidth("100px");

        tree.addItem("1");
        tree.setItemIcon("1", new ThemeResource("../runo/icons/16/ok.png"));

        String mainItem = "A very long item that should not wrap";
        String subItem = "Subitem - also long";

        tree.addItem(mainItem);
        tree.setItemIcon(mainItem, new ThemeResource(
                "../runo/icons/16/error.png"));

        tree.addItem(subItem);
        tree.setParent(subItem, mainItem);

        tree.expandItem("1");
        tree.expandItem(mainItem);
        tree.expandItem(subItem);

        addComponent(tree);
    }
View Full Code Here


                "../runo/icons/64/folder.png?" + new Date().getTime());
        ThemeResource notCachedFolderIconLarge = new ThemeResource(
                "../runo/icons/32/folder.png?" + new Date().getTime());
        ThemeResource notCachedFolderIconLargeOther = new ThemeResource(
                "../runo/icons/32/ok.png?" + new Date().getTime());
        Tree t = new Tree();
        t.setImmediate(true);

        t.addItem("Root 1");
        t.addItem("Root 11");
        t.addItem("Root 111");
        t.addItem("Root 1111");
        t.addItem("Sub 1");
        t.setItemIcon("Sub 1", notCachedFolderIconLargeOther);
        t.setParent("Sub 1", "Root 1");
        String longItemId = LoremIpsum.get(50);
        t.addItem(longItemId);
        t.setItemIcon(longItemId, notCachedFolderIconHuge);
        t.setParent(longItemId, "Root 11");
        t.addItem("abcdefghijklmn");

        String first = "abcdefghijklmnop";
        String second = "abcdefghijklmnopqrst";
        t.addItem(first);
        t.addItem(second);
        t.setParent(second, first);
        t.setItemIcon(first, notCachedFolderIconLarge);

        HorizontalLayout hlay = new HorizontalLayout();
        hlay.setStyleName(Reindeer.LAYOUT_BLUE);
        hlay.addComponent(t);
        hlay.setWidth(-1, Sizeable.UNITS_PIXELS);
View Full Code Here

        HorizontalLayout row = new HorizontalLayout();
        row.addStyleName("wrapping");
        row.setSpacing(true);
        addComponent(row);

        Tree tree = new Tree();
        tree.setSelectable(true);
        tree.setMultiSelect(true);
        Container generateContainer = ValoThemeUI.generateContainer(10, true);
        tree.setContainerDataSource(generateContainer);
        tree.setDragMode(TreeDragMode.NODE);
        row.addComponent(tree);
        tree.setItemCaptionPropertyId(ValoThemeUI.CAPTION_PROPERTY);
        tree.setItemIconPropertyId(ValoThemeUI.ICON_PROPERTY);
        tree.expandItem(generateContainer.getItemIds().iterator().next());

        tree.setDropHandler(new DropHandler() {
            @Override
            public AcceptCriterion getAcceptCriterion() {
                return AcceptAll.get();
            }

            @Override
            public void drop(DragAndDropEvent event) {
                Notification.show(event.getTransferable().toString());
            }
        });

        // Add actions (context menu)
        tree.addActionHandler(ValoThemeUI.getActionHandler());
    }
View Full Code Here

        return c;
    }

    /** Create new Tree and add it to current component container. */
    public Tree tree() {
        Tree c = new Tree();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

    /**
     * Create new Tree with given caption and add it to current component
     * container.
     */
    public Tree tree(String caption) {
        Tree c = tree();
        c.setCaption(caption);
        return c;
    }
View Full Code Here

        return c;
    }

    /** Create new Tree with given caption and listener. */
    public Tree tree(String caption, Property.ValueChangeListener changeListener) {
        Tree c = tree(caption);
        c.addListener(changeListener);
        return c;
    }
View Full Code Here

  public Component getView(Application application) {
    if (view == null) {
      VerticalLayout verticalLayout = new VerticalLayout();
      verticalLayout.setMargin(true);

      tree = new Tree("Compamies and Employees");
      verticalLayout.addComponent(tree);
      synchronized (this) {
        if (personManager != null) {
          refreshTree();
        }
View Full Code Here

  private static final long serialVersionUID = 1L;

  @Override
  protected AbstractSelect createSelectComponent() {
    Tree tree = createTree();
    tree.setSizeFull();
    return tree;
  }
View Full Code Here

      String buttonId = QueuesPanelRefresherUtil.getSubstitutedRootNodeId(substitutedUser.getLogin());
     
      container.getItem(substAssignedTasks).getItemProperty("debugId").setValue(buttonId);
    }

    final Tree substitutionsTree = getSubstitutionsTree();
    substitutionsTree.setContainerDataSource(container);
    VerticalLayout vl = new VerticalLayout();
    vl.setMargin(false);
    vl.setSpacing(false);
    vl.addComponent(substitutionsTree);
    substitutionsPanel.setContent(vl);
View Full Code Here

  {
    if(substitutionsTree != null)
    {
      return substitutionsTree;
    }
    substitutionsTree = new Tree();
    substitutionsTree.setItemCaptionPropertyId("name");
    substitutionsTree.setSelectable(false);
    substitutionsTree.setItemStyleGenerator(new ItemStyleGenerator()
    {
      @Override
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Tree$TreeTransferable

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.