Package org.netbeans.api.project.ui

Examples of org.netbeans.api.project.ui.OpenProjects


        ExceptionHelper.checkNotNullArgument(project, "project");
        this.project = project;
    }

    private void closeAffectedProjects() {
        OpenProjects openProjects = OpenProjects.getDefault();
        FileObject rootDir = project.getProjectDirectory();

        List<Project> toClose = new LinkedList<>();
        toClose.add(project);
        for (Project opened: openProjects.getOpenProjects()) {
            if (FileUtil.isParentOf(rootDir, opened.getProjectDirectory())) {
                toClose.add(project);
            }
        }

        openProjects.close(toClose.toArray(new Project[0]));
    }
View Full Code Here


     * project is a quorum project. If it is not, this returns null.
     *
     * @return
     */
    private Project getMainProject() {
        OpenProjects open = OpenProjects.getDefault();
        Project project = open.getMainProject();
       
        //in NetBeans 7.2, we may not have a main project
        //check the global selection to see if there's a project in there
        if(project == null) {
            project = globalProjectSelection;
        }
       
        //if their is no main project and the global selection does
        //not contain a quorum project, check to see if there's only
        //one project
        if(project == null && open.getOpenProjects()!= null && open.getOpenProjects().length == 1) {
            project = open.getOpenProjects()[0];
        }
       
        if(project != null) {
            MainFileProvider localProvider =
                project.getLookup().lookup(MainFileProvider.class);
View Full Code Here

     * is different than getMainProject.
     *
     * @return
     */
    private Project getSelectedProject() {
        OpenProjects open = OpenProjects.getDefault();
        Project project = globalProjectSelection;
       
       
        //if their is no global selection does
        //not contain a quorum project, check to see if there's only
        //one project
        if(project == null && open.getOpenProjects()!= null && open.getOpenProjects().length == 1) {
            project = open.getOpenProjects()[0];
        }
       
        //if it's still null, check the main project as a last resort
        if(project == null) {
            project = open.getMainProject();
        }
       
        if(project != null) {
            MainFileProvider localProvider =
                project.getLookup().lookup(MainFileProvider.class);
View Full Code Here

TOP

Related Classes of org.netbeans.api.project.ui.OpenProjects

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.