Package com.gwtext.client.widgets.tree

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


  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


  /**
   *
   */
  public MailFolderTreePanel() {

    this.rootNode = new TreeNode();

    setRootVisible( false );
    setRootNode( this.rootNode );
    setAnimate( false );
    setEnableDD( true );
View Full Code Here

  /**
   * @param mailFolder
   */
  public void buildTree( GWTMailbox mailbox ) {

    TreeNode rootNode = getRootNode();
    TreeNode newNode = UIFactory.createTreeNode( mailbox );
    if ( rootNode.getChildNodes().length > 0 ) {
      rootNode.replaceChild( newNode, rootNode.getChildNodes()[0] );
    } else {
      rootNode.appendChild( newNode );
    }
View Full Code Here

    setTitle( TextProvider.get().contact_folder_panel_title() );
    setLayout( new FitLayout() );
    setCollapsible( true );
    setIconCls( "contactfolder-icon" );

    this.rootNode = new TreeNode();

    this.treePanel = new TreePanel();
    this.treePanel.addListener( new ContactTreePanelListener() );
    this.treePanel.setRootVisible( false );
    this.treePanel.setRootNode( this.rootNode );
View Full Code Here

   */
  private void buildContactFolderList() {

    List<ContactFolder> folderList = GWTSessionManager.get().getContactFolderList();
    if ( folderList != null ) {
      TreeNode rootNode = this.treePanel.getRootNode();
      Node[] children = rootNode.getChildNodes();
      if ( children != null ) {
        for (Node child : children) {
          rootNode.removeChild( child );
        }
      }
      for (ContactFolder contactFolder : folderList) {
        addContactFolder( contactFolder );
      }
View Full Code Here

  /**
   * @param folder
   */
  public void addContactFolder( ContactFolder folder ) {

    TreeNode node = new TreeNode( GWTUtil.getTranslatedFolderName( folder ) );
    node.setUserObject( folder );
    node.setIcon( ImageProvider.CONTACT_FOLDER );
    this.treePanel.getRootNode().appendChild( node );
  }
View Full Code Here

   * ()
   */
  public void onMessagesChanged() {

    if ( this.currentTreeNode != null ) {
      final TreeNode selectedNode = this.currentTreeNode;
      ServiceProvider.getMailboxService().getFormattedMessageCount(
          ((GWTMailFolder) selectedNode.getUserObject()).getId(), new AsyncCallback<String>() {

            public void onFailure( Throwable caught ) {

              GWTExceptionHandler.handleException( caught );
            }

            public void onSuccess( String result ) {

              selectedNode.setText( result );
            }

          } );
    }
  }
View Full Code Here

        TextProvider.get().actions_deletefolder_warning(), new MessageBox.ConfirmCallback() {

          public void execute( String btnID ) {

            if ( "yes".equals( btnID ) ) {
              TreeNode folder = getSelectedTreeNode();
              if ( folder != null ) {
                PanelRegistry.LEFT_PANEL.mask();
                deleteFolder( folder );
              }
            }
View Full Code Here

        @Override
        public void handleSuccess(List<EntityData> children) {
            if (propName == null) {
                propName = "RootPropertyNode";
            }
            TreeNode parentNode = treePanel.getNodeById(propName);

            if (parentNode == null) {
                GWT.log("Cannot find node: " + propName, null);
                return;
            }

            // already loaded?
            // TODO - not a very good method
            if (parentNode.getFirstChild() != null) {
                // children are already fetched? Maybe?
                // TODO: think about this situation

                if (getSubpropertiesOfSubproperties) {
                    for (Object element2 : children) {
                        EntityData child = (EntityData) element2;
                        getSubProperties(child.getName(), false);
                    }
                }
                return;
            }

            for (Object element2 : children) {
                EntityData childData = (EntityData) element2;

                // if (!hasChild(clsName, childName)) {
                parentNode.appendChild(createTreeNode(childData));
                // }
            }

            if (getSubpropertiesOfSubproperties) {
                for (Object element2 : children) {
View Full Code Here

                }
            }
        }

        private boolean hasChild(String parentId, String childId) {
            TreeNode parentNode = treePanel.getNodeById(propName);

            Node[] children = parentNode.getChildNodes();

            for (Node child : children) {
                if (child.getId().equals(childId)) {
                    return true;
                }
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.