Package javax.swing.tree

Examples of javax.swing.tree.DefaultTreeModel.removeNodeFromParent()


            deathNode.setUserObject("Death" + "(" + deathNotificationList.size() + ")");
            if (deathNotificationList.isEmpty()) {
                treeModel.removeNodeFromParent(deathNode);
            }
        } else if (notification.getType() == Notification.Type.MIGRATION) {
            treeModel.removeNodeFromParent(
                    (MutableTreeNode) migrationNode.getChildAt(migrationNotificationList.indexOf(notification)));
            migrationNotificationList.remove(notification);
            migrationNode.setUserObject("Migration" + "(" + migrationNotificationList.size() + ")");
            if (migrationNotificationList.isEmpty()) {
                treeModel.removeNodeFromParent(migrationNode);
View Full Code Here


            treeModel.removeNodeFromParent(
                    (MutableTreeNode) migrationNode.getChildAt(migrationNotificationList.indexOf(notification)));
            migrationNotificationList.remove(notification);
            migrationNode.setUserObject("Migration" + "(" + migrationNotificationList.size() + ")");
            if (migrationNotificationList.isEmpty()) {
                treeModel.removeNodeFromParent(migrationNode);
            }
        }
        notificationRootNode.setUserObject("Notifications " + "(" + totalNotifications() + ")");
        //notificationTree.repaint();
    }
View Full Code Here

     * @param childNode the child node to remove
     * @param listener the <code>PropertyChangeListener</code>
     */
    public void removeChild(MCTMutableTreeNode childNode, PropertyChangeListener listener) {
        DefaultTreeModel treeModel = (DefaultTreeModel) childNode.getParentTree().getModel();
        treeModel.removeNodeFromParent(childNode);
        View viewManifestation = View.class.cast(childNode.getUserObject());
        viewManifestation.removePropertyChangeListener(listener);
        viewManifestation.putClientProperty(PARENT_CLIENT_PROPERTY_NAME, null);
    }

View Full Code Here

                            if (sourceRow < targetRow) index--;
                        }

                        switch(insertPosition) {
                            case BEFORE:
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, newParent, index);
                                break;
                            case AFTER:
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, newParent, index+1);
View Full Code Here

                            case BEFORE:
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, newParent, index);
                                break;
                            case AFTER:
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, newParent, index+1);
                                break;
                            case INTO_FOLDER: //最後の子として挿入
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, targetNode, targetNode.getChildCount());
View Full Code Here

                            case AFTER:
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, newParent, index+1);
                                break;
                            case INTO_FOLDER: //最後の子として挿入
                                model.removeNodeFromParent(sourceNode);
                                model.insertNodeInto(sourceNode, targetNode, targetNode.getChildCount());
                        }
                        TreeNode[] path = model.getPathToRoot(sourceNode);
                        ((JTree) tree).setSelectionPath(new TreePath(path));
                    }
View Full Code Here

      {
    node = (DefaultMutableTreeNode)path.getPathComponent(length-1);
    ContextNode binding = (ContextNode)node.getUserObject();
    context.unbind(binding.getName());
    DefaultTreeModel model = (DefaultTreeModel)getModel();
    model.removeNodeFromParent(node);
               
                // select the parent node and display its content
                DefaultMutableTreeNode parent = (DefaultMutableTreeNode)path.getPathComponent(length-2);
                setSelectionPath(new TreePath(parent.getPath()));
    ((ContextNode)parent.getUserObject()).display();
View Full Code Here

    {
        DefaultTreeModel tree = BrowserFrame.getTreeModel();

        while ( tree.getChildCount(node) > 0 )
        {
            tree.removeNodeFromParent((DefaultMutableTreeNode)tree.getChild(node, 0));
        }
    }

    public ListNodeListener getListNodeListener()
    {
View Full Code Here

                {
                    MutableTreeNode node = (MutableTreeNode)paths[i].getLastPathComponent();
                    if (node == dataModel.getRoot())
                        dataModel.setRoot(null);
                    else if (isInTree(node,dataModel)) // If false is already removed (a previous removed node was the parent)
                        dataModel.removeNodeFromParent(node);
                }
            }
        }
        else if ((currentTarget == updateButton.getHTMLInputElement()) ||
                 (currentTarget == insertBeforeButton.getHTMLInputElement()) ||
View Full Code Here

                {
                    MutableTreeNode node = (MutableTreeNode)paths[i].getLastPathComponent();
                    if (node == dataModel.getRoot())
                        dataModel.setRoot(null);
                    else if (isInTree(node,dataModel)) // If false is already removed (a previous removed node was the parent)
                        dataModel.removeNodeFromParent(node);
                }
            }
        }
        else if ((currentTarget == updateButton.getHTMLInputElement()) ||
                 (currentTarget == insertBeforeButton.getHTMLInputElement()) ||
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.