Package javax.swing.tree

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


      boolean isRoot = tree.getValue().equals(marker);
      if (UITreeOld.COMMAND_NEW.equals(command)) {
        treeState.commandNew(create(facesContext));
      } else if (UITreeOld.COMMAND_DELETE.equals(command)) {
        if (!isRoot) {
          marker.removeFromParent();
        }
        treeState.setLastMarker(null);
        treeState.setLastCommand(null);
      } else if (UITreeOld.COMMAND_CUT.equals(command)) {
        if (!isRoot) {
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

        final DefaultMutableTreeNode nodeToRemove = node;
        if (nodeToRemove == null) {
            return;
        }
        final MutableTreeNode parent = (MutableTreeNode) nodeToRemove.getParent();
        nodeToRemove.removeFromParent();
        final Info info = (Info) nodeToRemove.getUserObject();
        if (info != null) {
            info.setNode(null);
        }
        if (parent != null) {
View Full Code Here

      boolean isRoot = tree.getValue().equals(marker);
      if (UITree.COMMAND_NEW.equals(command)) {
        treeState.commandNew(create(facesContext));
      } else if (UITree.COMMAND_DELETE.equals(command)) {
        if (!isRoot) {
          marker.removeFromParent();
        }
        treeState.setLastMarker(null);
        treeState.setLastCommand(null);
      } else if (UITree.COMMAND_CUT.equals(command)) {
        if (!isRoot) {
View Full Code Here

        }
        for (from.children(); from.children().hasMoreElements();) {
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) from.children().nextElement();

            if (obj.equals(node.getUserObject())) {
                node.removeFromParent();
            }
            refresh();
            return true;
        }
        return false;
View Full Code Here

  }

  public String deleteNode() {
    DefaultMutableTreeNode marker = state.getMarker();
    if (marker != null) {
      marker.removeFromParent();
    } else {
      // todo: print a warning or use root?
    }
    return null;
  }
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.