public void setRoot(AgeAbstractClassImprint root) {
    Tree data = getData();

    if (root == null) {
      data.getRoot().setChildren(new TreeNode[0]);
      data.setRoot(data.getRoot());
      return;
    }

    TreeNode rootNode = data.getRoot();

    ImprintTreeNode clsRoot = nodeCreator.create(root);

    createTreeStructure(root, clsRoot);

    rootNode.setChildren(new TreeNode[] {clsRoot});

    data.setRoot(rootNode);

    data.openAll();
  }
Esempio n. 2
0
  /** @return */
  private TreeNode getInboxTreeNode() {

    Tree treeData = this.tree.getData();
    TreeNode[] nodes = treeData.getChildren(treeData.getRoot());
    if (nodes != null && nodes.length > 0) {
      if (GWTUtil.getGwtFolder(nodes[0]) instanceof GWTMailbox) {
        nodes = treeData.getChildren(nodes[0]);
      }

      for (TreeNode node : nodes) {
        GWTMailFolder folder = (GWTMailFolder) GWTUtil.getGwtFolder(node);
        if (folder.isInbox()) {
          return (TreeNode) node;
        }
      }
    }
    return null;
  }