Package javax.swing.tree

Examples of javax.swing.tree.TreeNode


    }

    @Override
    public void getRootHolders(ArrayList<SceneGraphObjectHolder> list){
        UniverseNode un=null;
        TreeNode tn=this;
        while(un==null && tn!=null){
            tn=tn.getParent();
            if(tn instanceof UniverseNode){
                un=(UniverseNode)tn;
            }
        }
        if(un!=null){
View Full Code Here


                //
                //make sure the node that fired this change still belongs
                //to our model (if the model was swapped in the middle of
                //a fetch operation, this can happen)
                //
                TreeNode parent = pNode;
                while (parent != null && parent.getParent() != null) parent = parent.getParent();
                if (parent == null || !parent.equals(model.getRoot()))
                    return;

                //
                //notify that the structure of the given node has been changed
                //
View Full Code Here

     * @param pNode the node
     *
     * @return a {@link PomNode} up the given node's hierarchy, or {@code null}
     */
    public PomNode getPomNode(final TreeNode pNode) {
        TreeNode parent = pNode;
        while (parent != null && !(parent instanceof PomNode)) parent = parent.getParent();

        return (PomNode) parent;
    }
View Full Code Here

        final PomNode pomNode = findPomNode(pEvent.getPomUrl());

        //noinspection unchecked
        final Enumeration<TreeNode> children = pomNode.children();
        while (children.hasMoreElements()) {
            final TreeNode node = children.nextElement();
            if (node instanceof PluginGoalNode) {
                final PluginGoalNode goalNode = (PluginGoalNode) node;
                if (goalNode.getGoal().equals(goal)) {

                    final int index = pomNode.getIndex(goalNode);
View Full Code Here

            if (path == null)
                return;

            final PomManager pomMgr = PomManager.getInstance(project);

            final TreeNode node = (TreeNode) path.getLastPathComponent();
            if (!(node instanceof GoalNode))
                return;

            final VirtualFile pomFile;
            final PomNode pomNode = model.getPomNode(node);
View Full Code Here

            final TreePath selection = tree.getSelectionPath();
            if (selection == null)
                return;

            final TreeNode node = (TreeNode) selection.getLastPathComponent();
            if (node instanceof PluginNode)
                navigateToSource((PluginNode) node);
            else if (node instanceof GoalNode)
                navigateToSource((GoalNode) node);
            else if (node instanceof PomNode)
View Full Code Here

        }
    }

    private class PomTreeExpander implements TreeExpander {
        private boolean hasExpandedProjects() {
            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                if (tree.isExpanded(new TreePath(model.getPathToRoot(node))))
                    return true;
            }

            return false;
View Full Code Here

            return false;
        }

        private boolean isPluginsNodeExpanded() {
            final TreeNode pluginsNode = model.getPluginsNode();
            return tree.isExpanded(new TreePath(model.getPathToRoot(pluginsNode)));
        }
View Full Code Here

        public boolean canExpand() {
            return !hasExpandedProjects() || !isPluginsNodeExpanded();
        }

        public void collapseAll() {
            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                tree.collapsePath(new TreePath(model.getPathToRoot(node)));
            }

            final TreeNode pluginsNode = model.getPluginsNode();
            tree.collapsePath(new TreePath(model.getPathToRoot(pluginsNode)));
        }
View Full Code Here

            final TreeNode pluginsNode = model.getPluginsNode();
            tree.collapsePath(new TreePath(model.getPathToRoot(pluginsNode)));
        }

        public void expandAll() {
            final TreeNode pluginsNode = model.getPluginsNode();
            tree.expandPath(new TreePath(model.getPathToRoot(pluginsNode)));

            final TreeNode projectsNode = model.getProjectsNode();
            //noinspection unchecked
            final Enumeration<TreeNode> projectNodes = projectsNode.children();
            while (projectNodes.hasMoreElements()) {
                final TreeNode node = projectNodes.nextElement();
                tree.expandPath(new TreePath(model.getPathToRoot(node)));
            }
        }
View Full Code Here

TOP

Related Classes of javax.swing.tree.TreeNode

Copyright © 2018 www.massapicom. 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.