Package javax.swing.tree

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


  }

  public String delete() {
    final DefaultMutableTreeNode node = findFirstSelected();
    if (node != null) {
      node.removeFromParent();
    }
    return null;
  }

  private DefaultMutableTreeNode findFirstSelected() {
View Full Code Here


        // based on the mergetype of the masterChild
        MergeHelpUtilities.mergeNodes("javax.help.SortMerge",
              masterAtM, slaveNodeChild);
       
        // Need to remove the slaveNodeChild from the list
        slaveNodeChild.removeFromParent();
        slaveNodeChild = null;
    } else {
        // Names are the same but the ID are not
        // Mark the nodes and add the slaveChild
        MergeHelpUtilities.markNodes(masterAtM, slaveNodeChild);
View Full Code Here

            DefaultMutableTreeNode child =
                (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

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

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

      if (e.getKeyChar() == 'r') {
    if (resource != null) {
        TreeNode parent = resource.getParent();
        int index = parent.getIndex(resource);
        System.out.println("Removing " + resource.toString());
        resource.removeFromParent();
        DefaultTreeModel dtm = (DefaultTreeModel) CheckboxTreeExample.this.checkboxTree.getModel();
        // dtm.nodeStructureChanged(parent);
        dtm.nodesWereRemoved(parent, new int[] { index }, new TreeNode[] { resource });
    }
      }
View Full Code Here

            DefaultMutableTreeNode child =
                (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

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

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

                i--;
            } else {
                explorerTreeRoot.add(child);
            }
           
            child.removeFromParent();
        }
       
        // We need to recreate the input of this node's parent (There was no input node because that spot was taken up by this gem
        // we go through the inputs and if the input doesn't exist, we create it.
        DefaultMutableTreeNode parent  =(DefaultMutableTreeNode)node.getParent();
View Full Code Here

    private void rebuildGemNode(ExplorerGemNode explorerGemNode) {
       
        // We get rid of all the 'old' inputs
        while (explorerGemNode.getChildCount() > 0) {
            DefaultMutableTreeNode child = (DefaultMutableTreeNode) explorerGemNode.getFirstChild();
            child.removeFromParent();
            inputsToNodeMap.remove(child.getUserObject());
        }
       
        // And repopulate with the new ones. (provided that they are not connected)
        Gem gem = explorerGemNode.getGem();
View Full Code Here

            DefaultMutableTreeNode child =
                (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

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

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

            DefaultMutableTreeNode child =
                (DefaultMutableTreeNode) treeModel.getChild(rootNode, 0);

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

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

  }

  public String delete() {
    final DefaultMutableTreeNode node = findFirstSelected();
    if (node != null) {
      node.removeFromParent();
    }
    return null;
  }

  private DefaultMutableTreeNode findFirstSelected() {
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.