Package com.gwtext.client.widgets.tree

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


   
    private void buildPkgTree(TreeNode root, PackageHierarchy.Folder fldr) {
        if (fldr.conf != null) {
            root.appendChild(loadPackage(fldr.name, fldr.conf));
        } else {
            TreeNode tn = new TreeNode();
            tn.setText(fldr.name);
            tn.setIcon("images/empty_package.gif"); //NON-NLS
            root.appendChild(tn);
            for (PackageHierarchy.Folder c : fldr.children) {
                buildPkgTree(tn, c);
            }
        }
View Full Code Here


            }
        }
    }

    private TreeNode loadPackage(String name, PackageConfigData conf) {
        TreeNode pn = ExplorerNodeConfig.getPackageItemStructure(name, conf.uuid);
//        TreeNode wsNode = new TreeNode(constants.WorkingSets(), "images/workingset.gif");
//        ExplorerNodeConfig.getWorkingSetItemsStructure(wsNode, conf.workingsets);
//        pn.appendChild(wsNode);
        pn.setUserObject(conf);
        return pn;
    }
View Full Code Here

public class ProcessServerPanel extends GenericPanel {

    protected ProcessServerPanel(String title, final ExplorerViewCenterPanel centertabbedPanel) {
        super(title, centertabbedPanel);

        TreeNode root = new TreeNode("");


        Map<String, String> pages = new HashMap<String, String>();
        pages.put("Processes",
        "http://localhost:8080/gwt-console/org.jboss.bpm.console.Application/" +
        "Application.html#showEditor=org.jboss.bpm.console.client.process.ProcessEditor");
        pages.put("Tasks",
        "http://localhost:8080/gwt-console/org.jboss.bpm.console.Application/" +
        "Application.html#showEditor=org.jboss.bpm.console.client.task.TaskEditor");
        pages.put("Reports",
        "http://localhost:8080/gwt-console/org.jboss.bpm.console.Application/" +
        "Application.html#showEditor=org.jboss.bpm.console.client.report.ReportEditor");
        for (Map.Entry<String, String> e : pages.entrySet()) {
            final TreeNode tn = new TreeNode(e.getKey());
            tn.setId(e.getKey());
            tn.setAttribute("url", e.getValue());
            root.appendChild(tn);
            tn.addListener(new TreeNodeListenerAdapter() {
                @Override
                public void onClick(Node node, EventObject eventObject) {
                  if (!centertabbedPanel.showIfOpen(tn.getId())) {
                      centertabbedPanel.addTab(tn.getText(), true, openEmbedded(tn.getAttribute("url")), tn.getId());
                  }
                }
            });

        }
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 Widget 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<SnapshotInfo[]>() {
                public void onSuccess(SnapshotInfo[] snaps) {
                  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

    });
  }

    private void buildDeploymentTree(TreeNode root, PackageHierarchy.Folder fldr) {
        if (fldr.conf != null) {
            TreeNode pkg = new TreeNode(fldr.conf.name);
            pkg.setIcon("images/snapshot_small.gif");
            pkg.setUserObject(fldr.conf);
            pkg.appendChild(new TreeNode(constants.PleaseWaitDotDotDot()));
            root.appendChild(pkg);
        } else {
            TreeNode tn = new TreeNode();
            tn.setText(fldr.name);
            tn.setIcon("images/empty_package.gif"); //NON-NLS
            root.appendChild(tn);
            for (PackageHierarchy.Folder c : fldr.children) {
                buildDeploymentTree(tn, c);
            }
        }
View Full Code Here

    private static Constants constants   = ((Constants) GWT.create( Constants.class ));

    public static TreeNode getPackageItemStructure(String packageName,
                                                   String uuid) {

        TreeNode pkg = new TreeNode( packageName );
        pkg.setAttribute( "uuid",
                          uuid );
        pkg.setAttribute( "icon",
                          "images/package.gif" );

        pkg.appendChild( makeItem( constants.BusinessRuleAssets(),
                                   "images/rule_asset.gif",
                                   AssetFormats.BUSINESS_RULE_FORMATS ) );
        pkg.appendChild( makeItem( constants.TechnicalRuleAssets(),
                                   "images/technical_rule_assets.gif",
                                   new String[]{AssetFormats.DRL} ) );
        pkg.appendChild( makeItem( constants.Functions(),
                                   "images/function_assets.gif",
                                   new String[]{AssetFormats.FUNCTION} ) );
        pkg.appendChild( makeItem( constants.DSLConfigurations(),
                                   "images/dsl.gif",

                                   new String[]{AssetFormats.DSL} ) );
        pkg.appendChild( makeItem( constants.Model(),
                                   "images/model_asset.gif",

                                   new String[]{AssetFormats.MODEL, AssetFormats.DRL_MODEL} ) );

        if ( Preferences.getBooleanPref( "flex-bpel-editor" ) ) {
            pkg.appendChild( makeItem( constants.RuleFlows(),
                                       "images/ruleflow_small.gif",
                                       new String[]{AssetFormats.RULE_FLOW_RF, AssetFormats.BPMN2_PROCESS, AssetFormats.BPEL_PACKAGE} ) );
        } else {
            pkg.appendChild( makeItem( constants.RuleFlows(),
                                       "images/ruleflow_small.gif",
                                       new String[]{AssetFormats.RULE_FLOW_RF, AssetFormats.BPMN2_PROCESS} ) );
        }

        pkg.appendChild( makeItem( constants.Enumerations(),
                                   "images/enumeration.gif",

                                   new String[]{AssetFormats.ENUMERATION} ) );

        pkg.appendChild( makeItem( constants.TestScenarios(),
                                   "images/test_manager.gif",

                                   new String[]{AssetFormats.TEST_SCENARIO} ) );

        pkg.appendChild( makeItem( constants.XMLProperties(),
                                   "images/new_file.gif",
                                   new String[]{AssetFormats.XML, AssetFormats.PROPERTIES} ) );

        pkg.appendChild( makeItem( constants.OtherAssetsDocumentation(),
                                   "images/new_file.gif",
                                   new String[0] ) );

    pkg.appendChild(makeItem(constants.WorkingSets(), "images/workingset.gif", new String[] {AssetFormats.WORKING_SET}));
   
        return pkg;
    }
View Full Code Here

    }

    private static TreeNode makeItem(final String txt,
                                     final String img,
                                     final String[] formats) {
        TreeNode tn = new TreeNode();
        tn.setIcon( img );
        tn.setText( txt );
        tn.setUserObject( new Object[]{formats, txt} );
        return tn;
    }
View Full Code Here

        return tn;
    }

    public static TreeNode getAdminStructure() {

        TreeNode adminNode = new TreeNode( constants.Admin() );
        //adminNode.setAttribute("icon", "images/managment.gif");

    String[][] adminStructure = new String[][] {
        { constants.Category(), "images/category_small.gif", "0"},
                { constants.Status(), "images/tag.png", "2" },
        { constants.Archive(), "images/backup_small.gif", "1" },
                { constants.EventLog(), "images/error.gif", "4" },
                { constants.UserPermission(), "images/icoUsers.gif", "5" },
        { constants.ImportExport(), "images/save_edit.gif", "3" },
        { constants.RulesVerification(), "images/rule_verification.png", "7" },
        { constants.About(), "images/information.gif", "6" }};

        for ( int i = 0; i < adminStructure.length; i++ ) {

            String[] packageData = adminStructure[i];
            TreeNode localChildNode = new TreeNode( packageData[0] );
      localChildNode.setAttribute("icon", packageData[1]);   //NON-NLS
      localChildNode.setAttribute("id", packageData[2]);

            adminNode.appendChild( localChildNode );
        }
        return adminNode;
    }
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.