Package com.gwtext.client.widgets.tree

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


        }
        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

    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

   * @param mailFolder
   * @return
   */
  public static TreeNode createTreeNode( GWTMailFolder mailFolder ) {

    TreeNode node = new TreeNode( mailFolder.getName() );
    node.setIcon( getFolderIcon( mailFolder ) );
    node.setUserObject( mailFolder );

    for ( int i = 0; i < mailFolder.getSubfolders().length; i++ ) {
      node.appendChild( createTreeNode( mailFolder.getSubfolders()[i] ) );
    }

    return node;
  }
View Full Code Here

    return node;
  }

  public static TreeNode createTreeNode( GWTMailbox mailbox ) {

    TreeNode node = new TreeNode( mailbox.getEmailAddress() );
    node.setIcon( getFolderIcon( mailbox ) );
    node.setUserObject( mailbox );

    for ( int i = 0; i < mailbox.getMailFolders().length; i++ ) {
      node.appendChild( createTreeNode( mailbox.getMailFolders()[i] ) );
    }

    return node;
  }
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.