Examples of HierarchicalContainer


Examples of com.vaadin.data.util.HierarchicalContainer

     * Creates a new empty tree with caption.
     *
     * @param caption
     */
    public Tree(String caption) {
        this(caption, new HierarchicalContainer());
    }
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

     * @see com.vaadin.data.Container.Viewer#setContainerDataSource(Container)
     */
    @Override
    public void setContainerDataSource(Container newDataSource) {
        if (newDataSource == null) {
            newDataSource = new HierarchicalContainer();
        }

        // Assure that the data source is ordered by making unordered
        // containers ordered by wrapping them
        if (Container.Hierarchical.class.isAssignableFrom(newDataSource
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

    /**
     * Creates an empty TreeTable with a default container.
     */
    public TreeTable() {
        super(null, new HierarchicalContainer());
    }
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

    /**
     * Creates an empty TreeTable with a default container.
     */
    public TreeTable() {
        super(null, new HierarchicalContainer());
    }
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

    public void drop(DragAndDropEvent dropEvent) {
        Transferable t = dropEvent.getTransferable();
        Component src = t.getSourceComponent();
        Object sourceItemId;
        HierarchicalContainer container = (HierarchicalContainer) tree.getContainerDataSource();
        if (src instanceof WidgetInfoDnDWrapper) { //add widget
            WidgetInfoDnDWrapper dragAndDropWrapper = (WidgetInfoDnDWrapper) src;
            WidgetItem wi = dragAndDropWrapper.widgetItem;
            Object widgetElement = new WidgetItemInStep(wi);
            Item subItem = container.addItem(widgetElement);
            subItem.getItemProperty("name").setValue(wi.getName());
            container.setChildrenAllowed(widgetElement, nvl(wi.getChildrenAllowed(), false));
            sourceItemId = widgetElement;
        } else {
            if (src != tree || !(t instanceof DataBoundTransferable)) {
                return;
            }
            sourceItemId = ((DataBoundTransferable) t).getItemId();
        }

        Tree.TreeTargetDetails dropData = ((Tree.TreeTargetDetails) dropEvent.getTargetDetails());
        Object targetItemId = dropData.getItemIdOver();
        VerticalDropLocation location = dropData.getDropLocation();
        if (container.getParent(targetItemId) == null) {  //the can be only one! ... root element2
            location = VerticalDropLocation.MIDDLE;
        }
        moveNode(sourceItemId, targetItemId, location);
    }
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

          messages.getMessage("dialog.delete.confirm"),
          messages.getMessage("dialog.delete.cancel"),
                new ConfirmDialog.Listener() {
                    public void onClose(ConfirmDialog dialog) {
                        if (dialog.isConfirmed()) {
                            HierarchicalContainer hc = (HierarchicalContainer) stepTree.getContainerDataSource();
                            hc.removeItemRecursively(widget);
                            showParams(null);
                        }
                    }
                }
        );
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

    }
  }

  private HierarchicalContainer prepareTreeContainer() {
    I18NSource messages = I18NSource.ThreadUtil.getThreadI18nSource();
    stepTreeContainer = new HierarchicalContainer();
    stepTreeContainer.addContainerProperty("name", String.class, messages.getMessage("stepTree.name.default"));
    stepTreeContainer.addContainerProperty("icon", Resource.class, getResource("icon.widget.default"));

    final WidgetItem widgetItem = new WidgetItem(
                "ROOT",
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

  }

  private void buildSubstitutedTasksViews(ProcessToolContext ctx, List<UserData> substitutedUsers,
      Map<UserData,ProcessToolBpmSession> substitutedUserToSession, List<ProcessQueue> userAvailableQueues)
  {
    final HierarchicalContainer container = new HierarchicalContainer();
   
    container.addContainerProperty("name",String.class,"");
    container.addContainerProperty("description",String.class,null);
    container.addContainerProperty("queueUserSession",QueueUserSession.class,null);
    container.addContainerProperty("enabled",Boolean.class,Boolean.TRUE);
    container.addContainerProperty("debugId",String.class,null);
   
    for(UserData substitutedUser: substitutedUsers)
    {
      ProcessToolBpmSession bpmSessionForSubstituted = substitutedUserToSession.get(substitutedUser);
      UserData liferaySubstitutedUser = ctx.getUserDataDAO().loadUserByLogin(substitutedUser.getLogin());
      liferaySubstitutedUser.getRoleNames().addAll(substitutedUser.getRoleNames());

      ProcessInstanceFilter substAssignedTasks = filterFactory.createOtherUserTaskForSubstitutedUser(liferaySubstitutedUser);

      container.addItem(substAssignedTasks);

      int total = buildSubstitutedTasks(ctx,bpmSessionForSubstituted,liferaySubstitutedUser,container,substAssignedTasks);
      int totalQueues = buildSubstitutedQueues(ctx,userAvailableQueues,bpmSessionForSubstituted,substitutedUser,container,substAssignedTasks);

      container.getItem(substAssignedTasks).getItemProperty("name").setValue(getMessage(substAssignedTasks.getName(), liferaySubstitutedUser.getRealName()) + " (" + total + ";" + totalQueues + ")");
      container.getItem(substAssignedTasks).getItemProperty("description")
          .setValue(getMessage("activity.substitutions.description",liferaySubstitutedUser.getRealName(),total,totalQueues));
     
      /* button id for the refresher */
      String buttonId = QueuesPanelRefresherUtil.getSubstitutedRootNodeId(substitutedUser.getLogin());
     
      container.getItem(substAssignedTasks).getItemProperty("debugId").setValue(buttonId);
    }

    final Tree substitutionsTree = getSubstitutionsTree();
    substitutionsTree.setContainerDataSource(container);
    VerticalLayout vl = new VerticalLayout();
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

    /**
     * Creates an empty TreeTable with a default container.
     */
    public TreeTable() {
        super(null, new HierarchicalContainer());
    }
View Full Code Here

Examples of com.vaadin.data.util.HierarchicalContainer

     * Creates a new empty tree with caption.
     *
     * @param caption
     */
    public Tree(String caption) {
        this(caption, new HierarchicalContainer());
    }
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.