Package javax.swing.tree

Examples of javax.swing.tree.DefaultMutableTreeNode.removeAllChildren()


  private void updateTypeTree() {
    if (this.ts == null) {
      return;
    }
    DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) this.typeTree.getModel().getRoot();
    rootNode.removeAllChildren();
    Type top = this.ts.getTopType();
    rootNode.setUserObject(top);
    List types = this.ts.getDirectSubtypes(top);
    for (int i = 0; i < types.size(); i++) {
      rootNode.add(createTypeTree((Type) types.get(i)));
View Full Code Here


        try {
            profileForm.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            DefaultMutableTreeNode expandingNode = (DefaultMutableTreeNode) event.getPath().getLastPathComponent();
            ProfileResourceNode prn = (ProfileResourceNode) expandingNode.getUserObject();
            profileForm.getInMemoryNodes().put(prn.getId(), expandingNode);
            expandingNode.removeAllChildren();
           
            final List<ProfileResourceNode> childNodes =
                profileManager.findProfileResourceNodeAndImmediateChildren(
                        profileForm.getProfile().getUuid(), prn.getId());
            if (!childNodes.isEmpty()) {
View Full Code Here

public class ResourceTreeWillExpandListener implements TreeWillExpandListener {

    @Override
    public void treeWillExpand(TreeExpansionEvent event) {
        DefaultMutableTreeNode node = (DefaultMutableTreeNode) event.getPath().getLastPathComponent();
        node.removeAllChildren();
        File file = (File) node.getUserObject();
        File[] children = file.listFiles();
        List<File> sortedChildren = ResourceDialogUtil.sortFiles(children);
        for (File f : sortedChildren) {
            if (f.isDirectory()) {
View Full Code Here

    {
        _idToTreePathMap.clear();
        // first clear out the tree
        DefaultTreeModel model = (DefaultTreeModel) _tsettree.getModel();
        DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();
        root.removeAllChildren();

        ArrayList<TreePath> expand = Lists.newArrayList();

        // add all the elements in the base layer
        DefaultMutableTreeNode base = new DefaultMutableTreeNode("Base Layer");
View Full Code Here

            // save root
            this.root = root;

            // clear tree and re-populate
            DefaultMutableTreeNode where = (DefaultMutableTreeNode)getRoot();
            where.removeAllChildren();
            nodeMap.clear();
            treeNodeMap.clear();

            buildTree(root, where);
           
View Full Code Here

        while (treeModel.getChildCount(rootNode) > 0) {
            DefaultMutableTreeNode child =
                (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

            treeModel.removeNodeFromParent(child);
            child.removeAllChildren();
            child.removeFromParent();
        }

        treeModel.nodeStructureChanged(rootNode);
        treeModel.reload();
View Full Code Here

    DefaultMutableTreeNode node = (DefaultMutableTreeNode) serviceExplorer.getModel().getRoot();

    node.setUserObject(new JLabel(currentlySelectedService
            + (BusTools.isReservedName(currentlySelectedService) ? " (Built-in)" : ""), getSwIcon("service.png"),
            SwingConstants.LEFT));
    node.removeAllChildren();

    serviceExplorer.setRootVisible(true);

    DefaultTreeModel model = (DefaultTreeModel) serviceExplorer.getModel();
View Full Code Here

  private void generateServiceExplorer() {
    DefaultMutableTreeNode node = (DefaultMutableTreeNode) serviceExplorer.getModel().getRoot();

    node.setUserObject(new JLabel(currentlySelectedService + (BusTools.isReservedName(currentlySelectedService) ? " (Built-in)" : ""), getSwIcon("service.png"), SwingConstants.LEFT));
    node.removeAllChildren();

    serviceExplorer.setRootVisible(true);

    DefaultTreeModel model = (DefaultTreeModel) serviceExplorer.getModel();
View Full Code Here

    // Reverse the list obtained via dfs
    Stack<Object> tempS = new Stack<Object>();
    for (int i = 0; i < defCU.getChildCount(); i++) {
      tempS.push(defCU.getChildAt(i));
    }
    defCU.removeAllChildren();
    while (!tempS.isEmpty()) {
      defCU.add((MutableTreeNode) tempS.pop());
    }
    log(wnode);
   
View Full Code Here

            compareLists(entry.subEntry, oldList.get(i).subEntry, child);
          } else {
            compareLists(entry.subEntry, new ArrayList<StatusEntry>(0), child);
          }
        } else if(oldList.get(i).subEntry != null) {
          child.removeAllChildren();
        }
        ((DefaultTreeModel)tree.getModel()).reload(child);
      }
    }
    for(int i = newList.size(); i < oldList.size(); i++) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.