Package com.gwtext.client.widgets.tree

Examples of com.gwtext.client.widgets.tree.TreeNode


        }
    }


    protected void insertNodeInTree(TreeNode parentNode, EntityData child) {
        TreeNode treeNode = createTreeNode(child);
        parentNode.appendChild(treeNode);
    }
View Full Code Here


    }



    protected void onPropertyDeleted(EntityData entity) {
        TreeNode propNode = findTreeNode(entity.getName());
        if (propNode != null) {
            Node parentNode = propNode.getParentNode();
            if (parentNode != null) {
                parentNode.removeChild(propNode);
            }
            else {
                propNode.remove();
            }
        }
    }
View Full Code Here

            }
        });
    }

    private void handleCreateEntitiesResult(AbstractCreateEntityInHierarchyResult<? extends OWLEntity> result) {
        TreeNode parentNode;
        if(result.getParent().isPresent()) {
            parentNode = this.findTreeNode(result.getParent().get());
        }
        else {
            parentNode = getAnnotationPropertiesRootNode();
View Full Code Here

    protected TreeNode findTreeNode(OWLEntity entity) {
        return findTreeNode(entity.getIRI().toString());
    }

    protected TreeNode findTreeNode(String id) {
        TreeNode root = treePanel.getRootNode();
        TreeNode node = findTreeNode(root, id, new ArrayList<TreeNode>());
        return node;
    }
View Full Code Here

        }
        else {
            visited.add(node);
            Node[] children = node.getChildNodes();
            for (Node element2 : children) {
                TreeNode n = findTreeNode((TreeNode) element2, id, visited);
                if (n != null) {
                    return n;
                }
            }
            return null;
View Full Code Here

        }
        return result;
    }

    protected TreeNode createTreeNode(EntityData entityData) {
        TreeNode node = new TreeNode(entityData.getBrowserText());
        node.setId(entityData.getName());
        node.setHref(null);
        node.setUserObject(entityData);
        setTreeNodeIcon(node);

        String text = getNodeText(entityData);
        node.setText(text);

        return node;
    }
View Full Code Here

  public String[] getColumnDataName(){
    return columnDataName;
  }
 
  public static TreeNode createTreeNode(NodeModel nodeModel){
    TreeNode tnode = null;
   
    if(nodeModel.columnDataName != null){
      NameValuePair nodeData[] = new NameValuePair[nodeModel.columnDataName.length];

      for (int i = 0; i < nodeModel.columnDataName.length; i++) {
        String value = nodeModel.getProperty(nodeModel.columnDataName[i]);
        if(value != null)
          nodeData[i] = new NameValuePair(nodeModel.columnDataName[i], value);
        else
          nodeData[i] = new NameValuePair(nodeModel.columnDataName[i], "");

      }

      tnode = ColumnNodeUI.getNewTreeNode(nodeData);     
    }else{
      tnode = new TreeNode();
    }
   
    tnode.setNodeModel(nodeModel);
   
    return tnode;
  }
View Full Code Here

  protected RHQPanel(String title, final ExplorerViewCenterPanel centertabbedPanel) {
    super(title, centertabbedPanel);
    setIconCls("nav-categories");

    TreeNode tn = new TreeNode("JON");
    tn.appendChild(addNode("Dashboard", "images/package_build.gif", centertabbedPanel, getBrowse()));

    TreeNode br = addNode("Browse resources","images/note.gif", centertabbedPanel, new Image("rhq/browse_resources.png"));
    tn.appendChild(br);
    br.appendChild(addNode("Platforms", null, centertabbedPanel, new Image("rhq/monitor.png")));
    br.appendChild(addNode("Servers", null, centertabbedPanel, getBrowse()));
    br.appendChild(addNode("Services", null, centertabbedPanel, getBrowse()));
    br.appendChild(addNode("Compatible groups", null, centertabbedPanel, getBrowse()));
    br.appendChild(addNode("Mixed groups", null, centertabbedPanel, getBrowse()));
    br.appendChild(addNode("Group definitions", null, centertabbedPanel, getBrowse()));

    tn.appendChild(addNode("Help", "images/topic.gif", centertabbedPanel, getBrowse()));


    add(genericExplorerWidget(tn));
View Full Code Here

    add(genericExplorerWidget(tn));
    tn.expand();
  }

  private TreeNode addNode(final String title, String image, final ExplorerViewCenterPanel centertabbedPanel, final Widget content) {
    TreeNode browse = new TreeNode(title);
    if (image != null) browse.setIcon(image);
    browse.addListener(new TreeNodeListenerAdapter() {
      @Override

      public void onClick(Node node, EventObject e) {
        if (!centertabbedPanel.showIfOpen(title)) {
          centertabbedPanel.addTab(title, true, content, title);
View Full Code Here

        return m;
    }

    private Panel deploymentExplorer() {

        final TreeNode root = new TreeNode(constants.PackageSnapshots());
        root.setIcon("images/silk/chart_organisation.gif"); //NON-NLS
        root.setId("snapshotRoot");                         //NON-NLS

        final TreePanel panel = genericExplorerWidget(root);


        deploymentListPackages(root);

        panel.addListener(new TreePanelListenerAdapter() {

            public void onCollapseNode(TreeNode node) {
                Node[] children = node.getChildNodes();

                for (Node child : children) {
                    node.removeChild(child);
                }

                if (node.getId().equals("snapshotRoot")) {
                    deploymentListPackages(root);
                } else {
                    node.appendChild(new TreeNode(constants.PleaseWaitDotDotDot()));
                }
            }

            public void onExpandNode(final TreeNode node) {
                if (node.getId().equals("snapshotRoot")) { //NON-NLS
                    return;
                }
                final PackageConfigData conf = (PackageConfigData) node.getUserObject();
                if (conf != null) {
                    RepositoryServiceFactory.getService().listSnapshots(conf.name, new GenericCallback() {
                        public void onSuccess(Object data) {
                            final SnapshotInfo[] snaps = (SnapshotInfo[]) data;
                            for (final SnapshotInfo snapInfo : snaps) {
                                TreeNode snap = new TreeNode();
                                snap.setTooltip(snapInfo.comment);
                                snap.setText(snapInfo.name);
                                snap.setUserObject(new Object[]{snapInfo, conf});
                                node.appendChild(snap);
                            }
                            node.removeChild(node.getFirstChild());
                        }
                    });
View Full Code Here

TOP

Related Classes of com.gwtext.client.widgets.tree.TreeNode

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.