Package javax.swing.tree

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


    {
        DefaultTreeModel aModel = (DefaultTreeModel)maTree.getModel();

        // Clear old tree.
        DefaultMutableTreeNode aRoot =(DefaultMutableTreeNode)aModel.getRoot();
        aRoot.removeAllChildren();

        // Create the new tree.
        CreateImplementationNameTree ();
        CreateServiceTree ();
        CreateInterfaceTree ();
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

            return;

        Object nodeInfo = node.getUserObject();
       try {
            if (StoreProductInfo.class.isInstance(nodeInfo)) {
                node.removeAllChildren();
                System.out.println("Get all product catagories.");
                Category[] categories = store.listCategories();
                for (int i = 0; i < categories.length; i++) {
                    node.add(new DefaultMutableTreeNode(
                            new ProductCategoryInfo(categories[i])));
View Full Code Here

            } else if (ProductCategoryInfo.class.isInstance(nodeInfo)) {
                ProductCategoryInfo info = (ProductCategoryInfo) nodeInfo;
                System.out.println("Get all products in: "
                        + info.getCategory().getName() + " catagory.");
                node.removeAllChildren();
                Product[] products = store.listProducts(info.getCategory()
                        .getCatId());
                for (int i = 0; i < products.length; i++) {
                    node.add(new DefaultMutableTreeNode(new ProductInfo(
                            products[i])));
View Full Code Here

    // Updates the tree model after a change in the underlying catalog directory
    private void _updateModel() {
        DefaultMutableTreeNode rootTreeNode = (DefaultMutableTreeNode) getRoot();
        CatalogDirectory dir = (CatalogDirectory)rootTreeNode.getUserObject();

        rootTreeNode.removeAllChildren();
        _nodeMap.clear();
        _nodeMap.put(dir, rootTreeNode);
        addNodes(rootTreeNode);
    }
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

                        if ( treePath != null ) {
                            if ( treePath.getPathCount() % 2 > 0 ) {
                                //  get the selected node
                                DefaultMutableTreeNode node;
                                node = ( DefaultMutableTreeNode ) treePath.getLastPathComponent();
                                node.removeAllChildren();
                               
                                //  get the pertinent object from the hashtable
                                Object object = hashtableObjects.get( event.getPath().toString() );
                               
                                if ( object != null ) {
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

  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

        try {

            final DefaultTreeModel model = (DefaultTreeModel) this.getModel();
            final DefaultMutableTreeNode root = (DefaultMutableTreeNode) model.getRoot();

            root.removeAllChildren();

            fillCollectionNode( root );
            reloadNode( root );
            expandNode( root );
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.