Package org.mevenide.idea.repository.tree

Examples of org.mevenide.idea.repository.tree.RepoTree


    public void refresh(final IRepositoryReader pRepo) {
        if (repos.containsKey(pRepo)) {
            final String repoName = pRepo.getRootURI().toString();
            final RepoTreeModel repoModel = new RepoTreeModel(pRepo);
            final RepoTree repoTree = repos.get(pRepo);
            repoTree.setModel(repoModel);
            repoTree.fetchNode(repoModel.getRoot());
            treesCardLayout.show(treesPanel, repoName);
        }
        else
            addRepo(pRepo);
    }
View Full Code Here


    }

    public void refreshSelectedRepo() {
        final Set<Map.Entry<IRepositoryReader, RepoTree>> entries = repos.entrySet();
        for (Map.Entry<IRepositoryReader, RepoTree> entry : entries) {
            final RepoTree tree = entry.getValue();
            if (tree.isVisible()) {
                refresh(entry.getKey());
                return;
            }
        }
    }
View Full Code Here

            }
        }
    }

    public int getSelectedItemsCount() {
        final RepoTree tree = getSelectedRepoTree();
        if (tree == null)
            return 0;

        final TreePath[] selections = tree.getSelectionPaths();
        if (selections == null || selections.length == 0)
            return 0;

        int count = 0;
        for (TreePath path : selections) {
View Full Code Here

        return count;
    }

    public RepoPathElement[] getSelectedItems() {
        final RepoTree tree = getSelectedRepoTree();
        if (tree == null)
            return new RepoPathElement[0];

        final TreePath[] selections = tree.getSelectionPaths();
        if (selections == null || selections.length == 0)
            return new RepoPathElement[0];

        final Set<RepoPathElement> elements = new HashSet<RepoPathElement>(selections.length);
        for (TreePath path : selections) {
View Full Code Here

        else
            addRepo(pRepo);
    }

    protected RepoTree createRepoTree(final IRepositoryReader pRepo) {
        final RepoTree tree;
        if (pRepo != null)
            tree = new RepoTree(new RepoTreeModel(pRepo));
        else
            tree = new RepoTree();
        final ActionManager actionMgr = ActionManager.getInstance();
        PopupHandler.installPopupHandler(tree, actionGroup, PLACE, actionMgr);
        return tree;
    }
View Full Code Here

        final String repoName = pRepo.getRootURI().toString();

        //
        //create new tree and model for the repo
        //
        final RepoTree repoTree = createRepoTree(pRepo);

        //
        //store the tree in the tree-cache, and add it to the layout
        //
        final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(repoTree);
        treesPanel.add(scrollPane, repoName);
        repos.put(pRepo, repoTree);
        treesCardLayout.show(treesPanel, repoName);

        //
        //later on, start fetching the root node
        //
        final TreeModel model = repoTree.getModel();
        if (model instanceof RepoTreeModel) {
            final RepoTreeModel repoModel = (RepoTreeModel) model;
            repoTree.fetchNode(repoModel.getRoot());
        }
        return repoTree;
    }
View Full Code Here

            selectionListener = new MyTreeSelectionListener(pBuilder);
        }

        @Override
        protected RepoTree addRepo(final IRepositoryReader pRepo) {
            final RepoTree tree = super.addRepo(pRepo);
            tree.addTreeSelectionListener(selectionListener);
            return tree;
        }
View Full Code Here

TOP

Related Classes of org.mevenide.idea.repository.tree.RepoTree

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.