Package javax.swing.tree

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


                        TreePath pathNewChild = null;

                        TreeNode sourceFather = source.getParent();
                        int index = sourceFather.getIndex(source);
                        source.removeFromParent();

                        treeModel.nodesWereRemoved(sourceFather,
                                new int[] { index }, new Object[] { source });

                        ((GanttTreeTableModel) treeModel).insertNodeInto(
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

            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 void removePage( DialogPage page ) {
        DefaultMutableTreeNode treeNode = getNode(page);
        TreeNode parentNode = treeNode.getParent();
       
        treeNode.removeFromParent();
       
        // If we've already been constructed, then update our model and cards
        if( pagePanel != null ) {
            JComponent control = page.getControl();
            pagePanel.remove(control);
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

      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

      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

  }

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

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

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.