This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 47731 - [40cat] Close All Projects action
Summary: [40cat] Close All Projects action
Status: CLOSED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hrebejk
URL:
Keywords:
: 70221 (view as bug list)
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-08-23 19:21 UTC by llturro
Modified: 2012-11-01 22:40 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description llturro 2004-08-23 19:21:33 UTC
Currently the only way to close all projects is
going one by one. It would be good if we could
close them all at once.
Comment 1 Jesse Glick 2004-08-23 20:41:08 UTC
Just multiselect them (e.g. in the Projects tab using the Shift key)
and you can close them all (by context menu or File menu).

Jano feel free to reopen if you think it may be desirable to have a
File -> Close All Projects action.
Comment 2 Marian Mirilovic 2005-12-20 16:04:59 UTC
This issue was solved long time ago. Because nobody has reopened it neither
added comments, we are verifying/closing it now. 
If you are still able to reproduce the problem, please reopen. 

Thanks in advance.
Comment 3 llturro 2005-12-20 16:46:44 UTC
Closing all projects:

1) CTRL-A (select all in project view)
2) File -> Close n projects

Contextual menu doesn't work when project nodes are expanded.

I do agree closing it, although isn't solved miriam ;D
Comment 4 Jesse Glick 2005-12-20 19:44:09 UTC
True, it's more awkward than it probably needs to be. Question is whether longer
term we expect users to be routinely closing all projects. Probably subsumed by
other efforts to make project snapshots or other kinds of groupings.
Comment 5 markiewb 2012-08-24 22:53:37 UTC
*** Bug 70221 has been marked as a duplicate of this bug. ***
Comment 6 markiewb 2012-08-24 22:59:30 UTC
It also easy to implement as an action. We only need a committer - as in #190839 "Close other projects". Anybody?

package closeotherprojects;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ui.OpenProjects;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;

@ActionID(
    category = "Project",
id = "closeotherprojects.CloseAllProjectsAction")
@ActionRegistration(
    displayName = "#CTL_CloseAllProjectsAction")
@Messages("CTL_CloseAllProjectsAction=Close all projects")
@ActionReference(path = "Projects/Actions")
public final class CloseAllProjectsAction implements ActionListener
{

    public CloseAllProjectsAction()
    {
    }

    @Override
    public void actionPerformed(ActionEvent ev)
    {
        OpenProjects manager = OpenProjects.getDefault();
        List<Project> openProjects = new ArrayList<Project>(Arrays.asList(manager.getOpenProjects()));

        if (!openProjects.isEmpty())
        {
            Project[] projectsToBeClosed = openProjects.toArray(new Project[openProjects.size()]);
            System.out.println("closing " + projectsToBeClosed);

            manager.close(projectsToBeClosed);
        }


    }
}
Comment 7 markiewb 2012-09-04 18:28:07 UTC
There was already plugin for it. But only verified until NB7.0

http://plugins.netbeans.org/plugin/37135/close-all-project
Comment 8 markiewb 2012-11-01 22:40:16 UTC
(In reply to comment #7)
> There was already plugin for it. But only verified until NB7.0
> 
> http://plugins.netbeans.org/plugin/37135/close-all-project

FYI: I reimplemented it http://plugins.netbeans.org/plugin/45122/?show=true
Comment 9 markiewb 2012-11-01 22:40:51 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > There was already plugin for it. But only verified until NB7.0
> > 
> > http://plugins.netbeans.org/plugin/37135/close-all-project
> 
> FYI: I reimplemented it http://plugins.netbeans.org/plugin/45122/?show=true

FYI: I reimplemented it http://plugins.netbeans.org/plugin/45122/?show=true
for 7.0, 7.1, 7.2, 7.3