Examples of BrowserTreeNode


Examples of org.arch4j.ui.tree.BrowserTreeNode

          if ( elemName == null ) {
            elemName = anElement.getName();
          }
        }
       
        BrowserTreeNode theNode = new BrowserTreeNode();
        theNode.setText( elemName );
        theNode.setIconAccessor("folderc");
        theNode.setAction("showElementPanel");
        theNode.setUserObject(anElement);
        theNode.setName("element");
       
        // set the menu if found
        JPopupMenu theNodeMenu = getCommandManager().createPopupMenu( menuName );
       
        // if no menu found, use the default one.
        if ( theNodeMenu == null ) {
          theNode.setMenu( getCommandManager().createPopupMenu( "nodeMenu" ));
        }
        else {
          theNode.setMenu( theNodeMenu );
        }
       
        theNode.setEnabled(true);
       
        return theNode;
    }
View Full Code Here

Examples of org.gjt.jclasslib.browser.BrowserTreeNode

        throw new IllegalArgumentException("index " + index + " not found in local variable table");
    }

    private void handleInterfaceLink(int index) {
        TreePath interfacesPath = services.getBrowserComponent().getTreePane().getPathForCategory(BrowserTreeNode.NODE_INTERFACE);
        BrowserTreeNode interfacesNode = (BrowserTreeNode)interfacesPath.getLastPathComponent();
        if (index >= interfacesNode.getChildCount()) {
            throw new IllegalArgumentException("Invalid interface index " + index);
        }

        TreePath path = interfacesPath.pathByAddingChild(interfacesNode.getChildAt(index));
        selectPath(path);
    }
View Full Code Here

Examples of org.gjt.jclasslib.browser.BrowserTreeNode

        tree.setSelectionPath(path);
        tree.scrollPathToVisible(path);
    }

    private TreePath findAttributeChildNode(TreePath path, Class<? extends AttributeInfo> attributeClass) {
        BrowserTreeNode methodNode = (BrowserTreeNode)path.getLastPathComponent();
        for (int i = 0; i < methodNode.getChildCount(); i++) {
            BrowserTreeNode attributeNode = (BrowserTreeNode)methodNode.getChildAt(i);
            if (attributeNode.getElement().getClass() == attributeClass) {
                return path.pathByAddingChild(attributeNode);
            }
        }
        throw new RuntimeException("No attribute node for class " + attributeClass + " found");
    }
View Full Code Here

Examples of org.gjt.jclasslib.browser.BrowserTreeNode

    }

    private TreePath findParentNode(JTree tree, Class elementClass) {
        TreePath path = tree.getSelectionPath();
        while (path != null) {
            BrowserTreeNode node = (BrowserTreeNode)path.getLastPathComponent();
            if (node.getElement().getClass() == elementClass) {
                break;
            } else {
                path = path.getParentPath();
            }
        }
View Full Code Here

Examples of org.openquark.gems.client.browser.BrowserTreeNode

        public JPopupMenu getPopupMenu(TreePath selectionPath) {

            // Create the popup menu so we can add our custom items.
            JPopupMenu popupMenu = new JPopupMenu();

            BrowserTreeNode selectedNode = (selectionPath == null) ? null : (BrowserTreeNode) selectionPath.getLastPathComponent();

            if (selectedNode instanceof GemDrawer) {
                // The node represents a "module".
               
                if (((GemDrawer)selectedNode).isNamespaceNode()) {
                    // a module namespace node is a 'phantom' node that does not really
                    // correspond to an actual module
                   
                } else {
                    // Add the 'Change Working Module' menu item.
                    ModuleName moduleName = ((GemDrawer) selectedNode).getModuleName();
                    Action changeModuleAction = getChangeModuleAction(moduleName);
                    popupMenu.add(GemCutter.makeNewMenuItem(changeModuleAction));

                    // Add a separator.
                    popupMenu.addSeparator();

                    // Add menu items for the workspace.
                    popupMenu.add(GemCutter.makeNewMenuItem(getSyncModuleAction(moduleName)));
                    popupMenu.add(GemCutter.makeNewMenuItem(getSyncModuleToRevisionAction(moduleName)));
                    popupMenu.add(GemCutter.makeNewMenuItem(getRevertModuleAction(moduleName)));
                    popupMenu.addSeparator();
                    popupMenu.add(GemCutter.makeNewMenuItem(getAddTypeDeclsToModuleAction(moduleName)));
                    popupMenu.add(GemCutter.makeNewMenuItem(getCleanModuleImportsAction(moduleName)));
                    popupMenu.add(GemCutter.makeNewMenuItem(getRenameModuleAction(moduleName)));
                    popupMenu.add(GemCutter.makeNewMenuItem(getRemoveModuleAction(moduleName)));
                }
                   
            } else if (selectedNode instanceof GemTreeNode) {
                // The node represents a gem.
                // Add a 'Load Design...' menu item to load the gem design.
           
                GemEntity gemEntity = (GemEntity) selectedNode.getUserObject();
                popupMenu.add(GemCutter.makeNewMenuItem(getOpenDesignAction(gemEntity)));
                popupMenu.add(GemCutter.makeNewMenuItem(getRenameGemAction(gemEntity)));
                popupMenu.add(GemCutter.makeNewMenuItem(getSearchForGemAction(gemEntity)));
                popupMenu.add(GemCutter.makeNewMenuItem(getSearchForGemDefinitionAction(gemEntity)));
            }
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.