Package com.gwtext.client.widgets.tree

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


    private Widget infoPanel() {
        return packageTree();
    }

    protected Widget packageTree() {
        TreeNode pkg = ExplorerNodeConfig.getPackageItemStructure( parentConf.name,
                                                                   snapInfo.uuid );
        pkg.setUserObject( snapInfo );
        TreeNode root = new TreeNode( snapInfo.name );
        root.appendChild( pkg );
        TreePanel tp = GenericPanel.genericExplorerWidget( root );
        tp.setRootVisible( false );
        tp.addListener( new TreePanelListenerAdapter() {

            public void onClick(TreeNode node,
View Full Code Here


        pop.setTitle(constants.SelectWorkingSets());

        treePanel = new TreePanel();
        treePanel.setWidth("100%");
        treePanel.setHeight("100%");
        final TreeNode root = new TreeNode("ROOT");
        root.setChecked(false);
        treePanel.setRootNode(root);
        treePanel.setRootVisible(false);


    RepositoryServiceFactory.getService().listAssets(asset.metaData.packageUUID,
        new String[] { AssetFormats.WORKING_SET }, 0, -1, "workingsetList",
        new GenericCallback<TableDataResult>() {

          public void onSuccess(TableDataResult result) {

            for (int i = 0; i < result.data.length; i++) {
              TreeNode node = new TreeNode(result.data[i].getDisplayName());
              node.setUserObject(result.data[i].id);
              node.setChecked(WorkingSetManager.getInstance().isWorkingSetActive(
                  asset.metaData.packageName, result.data[i].id));
              root.appendChild(node);
            }
          }
        });

        save = new Button(constants.SaveAndClose());
        save.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent event) {
                TreeNode[] checked = treePanel.getChecked();

                String[] wsUUIDs = new String[checked.length];
                for (int i = 0; i < checked.length; i++) {
                    TreeNode treeNode = checked[i];
                    wsUUIDs[i] = (String) treeNode.getUserObject();
                }


                WorkingSetManager.getInstance().applyWorkingSets(asset.metaData.packageName, wsUUIDs, new Command() {
View Full Code Here

        packagesPanel.remove(1);
        packagesPanel.add(packageExplorer(centertabbedPanel));
    }

  private Widget packageExplorer(final ExplorerViewCenterPanel tabPanel) {
    TreeNode rootNode = new TreeNode(constants.Admin());

    TreeNode packageRootNode = new TreeNode(constants.Packages());
    packageRootNode.setAttribute("icon", "images/silk/chart_organisation.gif"); // NON-NLS
    loadPackages(packageRootNode);

    /*
     * TreeNode globalRootNode = new TreeNode("Global area");
     * globalRootNode.setAttribute("icon",
 
View Full Code Here

    private void loadGlobal(final TreeNode root) {
        RepositoryServiceFactory.getService().loadGlobalPackage(
                new GenericCallback<PackageConfigData>() {
                    public void onSuccess(PackageConfigData value) {

                                TreeNode globalRootNode = ExplorerNodeConfig.getPackageItemStructure("Global Area", value.uuid);
                                globalRootNode.setUserObject(value);
                               
                                globalRootNode.setAttribute("icon", "images/silk/chart_organisation.gif");   //NON-NLS
                                globalRootNode.setAttribute("id", "globalarea");
                           
                                root.appendChild(globalRootNode);

                    }
                });
View Full Code Here

   
    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

        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

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.