Package com.gwtext.client.widgets.tree

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


        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


        }
        return adminNode;
    }

    public static TreeNode getRulesStructure() {
        TreeNode tn = new TreeNode();
        tn.setText( constants.AssetsTreeView() );
        tn.setExpanded( true );

        TreeNode tnc = new TreeNode();
        tnc.setIcon( "images/find.gif" ); //NON-NLS
        tnc.setId( "FIND" );
        tnc.setText( constants.Find() );

        final TreeNode inbox = getInboxStructure();
        tn.appendChild( tnc );

        tn.appendChild( inbox );
        if ( ExplorerLayoutManager.shouldShow( Capabilities.SHOW_PACKAGE_VIEW ) ) {
            tn.appendChild( getStatesStructure() );
        }
        tn.appendChild( getCategoriesStructure() );

        //seem to have to open it on a timer...
        Timer t = new Timer() {
            public void run() {
                inbox.expand();
            }
        };
        t.schedule( 100 );

        return tn;
View Full Code Here

        return tn;

    }

    private static TreeNode getInboxStructure() {
        final TreeNode treeNode = new TreeNode( "Inbox" );
        treeNode.setAttribute( "icon",
                               "images/inbox.gif" ); //NON-NLS
        treeNode.setAttribute( "id",
                               "inboxes" );

        treeNode.setAttribute("open", false);
       
        TreeNode incoming = new TreeNode( constants.IncomingChanges() );
        incoming.setId( "inbox3" );
        incoming.setAttribute( "icon",
                               "images/category_small.gif" ); //NON-NLS
        incoming.setUserObject( Inbox.INCOMING );
        treeNode.appendChild( incoming );

        TreeNode recentOpened = new TreeNode( constants.RecentlyOpened() );
        recentOpened.setId( "inbox1" );
        recentOpened.setAttribute( "icon",
                                   "images/category_small.gif" ); //NON-NLS
        recentOpened.setUserObject( Inbox.RECENT_VIEWED );
        treeNode.appendChild( recentOpened );

        TreeNode recentEdited = new TreeNode( constants.RecentlyEdited() );
        recentEdited.setId( "inbox2" );
        recentEdited.setAttribute( "icon",
                                   "images/category_small.gif" ); //NON-NLS
        recentEdited.setUserObject( Inbox.RECENT_EDITED );
        treeNode.appendChild( recentEdited );

        treeNode.expand();

        return treeNode;
View Full Code Here

        return treeNode;

    }

    public static TreeNode getCategoriesStructure() {
        final TreeNode treeNode = new TreeNode( constants.ByCategory() );
        treeNode.setAttribute( "icon",
                               "images/silk/chart_organisation.gif" );
        treeNode.setAttribute( "id",
                               CATEGORY_ID );
        doCategoryNode( treeNode,
                        "/" );
        return treeNode;
    }
View Full Code Here

                                                                           } else {
                                                                               for ( int i = 0; i < value.length; i++ ) {

                                                                                   final String current = value[i];
                                                                                   System.err.println( "VALUE: " + current + "(" + i + ")" );
                                                                                   final TreeNode childNode = new TreeNode();
                                                                                   childNode.setIcon( "images/category_small.gif" );
                                                                                   childNode.setText( current );

                                                                                   childNode.setUserObject( (path.equals( "/" )) ? current : path + "/" + current );
                                                                                   childNode.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );
                                                                                   childNode.addListener( new TreeNodeListenerAdapter() {
                                                                                       boolean expanding = false;

                                                                                       public void onExpand(Node node) {

                                                                                           if ( !expanding ) {
                                                                                               expanding = true;
                                                                                               infanticide( childNode );
                                                                                               doCategoryNode( childNode,
                                                                                                               (String) childNode.getUserObject() );
                                                                                               childNode.expand();
                                                                                               expanding = false;
                                                                                           }
                                                                                       }
                                                                                   } );
View Full Code Here

        }
    }

    public static TreeNode getStatesStructure() {

        final TreeNode treeNode = new TreeNode( constants.ByStatus() );
        treeNode.setAttribute( "icon",
                               "images/status_small.gif" ); //NON-NLS
        treeNode.setAttribute( "id",
                               STATES_ID );

        RepositoryServiceFactory.getService().listStates( new GenericCallback<String[]>() {
            public void onSuccess(String[] value) {
                for ( int i = 0; i < value.length; i++ ) {
                    TreeNode childNode = new TreeNode( value[i] );
                    childNode.setAttribute( "icon",
                                            "images/category_small.gif" ); //NON-NLS
                    childNode.setUserObject( "-" + value[i] );
                    treeNode.appendChild( childNode );
                }
            }
        } );
View Full Code Here

        return treeNode;
    }

    public static TreeNode getQAStructure(final ExplorerViewCenterPanel centerPanel) {

        final TreeNode treeNode = new TreeNode();
        treeNode.setText( constants.QA() );

        final TreeNode scenarios = new TreeNode();
        scenarios.setText( constants.TestScenariosInPackages() );
        scenarios.setIcon( "images/test_manager.gif" ); //NON-NLS

        final EditItemEvent edit = new EditItemEvent() {
            public void open(String key) {
                centerPanel.openAsset( key );
            }

            public void open(MultiViewRow[] rows) {
                for ( MultiViewRow row : rows ) {
                    centerPanel.openAsset( row.uuid );
                }
            }
        };

        scenarios.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );
        treeNode.appendChild( scenarios );

        final TreeNode analysis = new TreeNode();
        analysis.setText( constants.Analysis() );
        analysis.setIcon( "images/analyze.gif" ); //NON-NLS
        analysis.setExpanded( false );
        analysis.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );

        if ( Preferences.getBooleanPref( "verifier" ) ) {
            treeNode.appendChild( analysis );
        }

        scenarios.addListener( new TreeNodeListenerAdapter() {
            public void onExpand(Node node) {

                RepositoryServiceFactory.getService().listPackages( new GenericCallback<PackageConfigData[]>() {
                    public void onSuccess(PackageConfigData[] conf) {
                        for ( int i = 0; i < conf.length; i++ ) {
                            final PackageConfigData c = conf[i];
                            TreeNode pkg = new TreeNode();
                            pkg.setText( c.name );
                            pkg.setIcon( "images/package.gif" ); //NON-NLS

                            scenarios.appendChild( pkg );
                            pkg.addListener( new TreeNodeListenerAdapter() {
                                public void onClick(Node node,
                                                    EventObject e) {
                                    if ( !centerPanel.showIfOpen( "scenarios" + c.uuid ) ) { //NON-NLS
                                        String m = Format.format( constants.ScenariosForPackage(),
                                                                  c.name );
                                        centerPanel.addTab( m,
                                                            true,
                                                            new ScenarioPackageView( c.uuid,
                                                                                     c.name,
                                                                                     edit,
                                                                                     centerPanel ),
                                                            "scenarios" + c.uuid ); //NON-NLS
                                    }
                                }
                            } );
                        }
                        scenarios.removeChild( scenarios.getFirstChild() );

                    }
                } );
            }

            public void onCollapse(Node node) {
                Node[] cs = node.getChildNodes();
                for ( int i = 0; i < cs.length; i++ ) {
                    node.removeChild( cs[i] );
                }
                node.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );
            }
        } );

        analysis.addListener( new TreeNodeListenerAdapter() {

            public void onExpand(Node node) {
                RepositoryServiceFactory.getService().listPackages( new GenericCallback<PackageConfigData[]>() {
                    public void onSuccess(PackageConfigData[] conf) {

                        for ( int i = 0; i < conf.length; i++ ) {
                            final PackageConfigData c = conf[i];
                            TreeNode pkg = new TreeNode();
                            pkg.setText( c.name );
                            pkg.setIcon( "images/package.gif" ); //NON-NLS

                            analysis.appendChild( pkg );
                            pkg.addListener( new TreeNodeListenerAdapter() {
                                public void onClick(Node node,
                                                    EventObject e) {
                                    if ( !centerPanel.showIfOpen( "analysis" + c.uuid ) ) { //NON-NLS
                                        final EditItemEvent edit = new EditItemEvent() {
                                            public void open(String key) {
                                                centerPanel.openAsset( key );
                                            }

                                            public void open(MultiViewRow[] rows) {
                                                for ( MultiViewRow row : rows ) {
                                                    centerPanel.openAsset( row.uuid );
                                                }
                                            }
                                        };
                                        String m = Format.format( constants.AnalysisForPackage(),
                                                                  c.name );
                                        centerPanel.addTab( m,
                                                            true,
                                                            new AnalysisView( c.uuid,
                                                                              c.name,
                                                                              edit ),
                                                            "analysis" + c.uuid ); //NON-NLS
                                    }
                                }
                            } );
                        }
                        analysis.removeChild( analysis.getFirstChild() );

                    }
                } );
            }

            public void onCollapse(Node node) {
                Node[] cs = node.getChildNodes();
                for ( int i = 0; i < cs.length; i++ ) {
                    node.removeChild( cs[i] );
                }
                node.appendChild( new TreeNode( constants.PleaseWaitDotDotDot() ) );
            }
        } );

        return treeNode;
    }
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

        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

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.