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 41853 - Close all project's documents when closing the project
Summary: Close all project's documents when closing the project
Status: CLOSED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jiri Rechtacek
URL:
Keywords: API
: 42241 (view as bug list)
Depends on:
Blocks: 41835
  Show dependency tree
 
Reported: 2004-04-08 14:05 UTC by Petr Hrebejk
Modified: 2006-03-24 09:47 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Hrebejk 2004-04-08 14:05:44 UTC
An email from Jesse said following (and we then
decided that it should be implemented):

Minor possible enhancement for Jano and Petr to
consider: if you have a bunch of files open in the
editor from a project and the project is closed in
the GUI, perhaps you want to close these files
too. Not as nice as a full project <-> window
system correspondence, but a start. (Actually I
think making all window system state
project-specific is nonsense, and won't work for
us anyway, but at least a list of files open in a
project might be a good thing to store, later on?)

Suggested simple impl: add some utility class to
o.n.spi.project.ui.support to close all files open
by a Project. (I.e.: find all open TopComponent's
in the mode CloneableEditorSupport.EDITOR_MODE for
which the activatedNodes contains a file selection
which is owned by that Project, and call close()
on each - OK if it returns false, e.g. save dialog
cancelled.) Call this from
J2SEProject.ProjectOpenedHookImpl.projectClosed(),
and add a note to ProjectOpenedHook.projectClosed
Javadoc that this method would be a good thing to
call at that time.-J.
Comment 1 Petr Hrebejk 2004-05-03 13:15:50 UTC
*** Issue 42241 has been marked as a duplicate of this issue. ***
Comment 2 Jesse Glick 2004-05-10 20:39:59 UTC
Probably could also be handled automatically by projects/projectui
without the need for the project to do anything. No strong opinion
which is better. Marking API in case you use the originally suggested
option.
Comment 3 Jiri Rechtacek 2004-05-11 15:56:45 UTC
fixed, no API change (limited only on projectui module). If the
project's documents would be closed by ProjectOpenedHook then will be
close separately and an user will be notifies about modified documents
again to each project. Now is showed only once notification with
options Save/Discard/Cancel.

Checking in src/org/netbeans/modules/project/ui/Bundle.properties;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/Bundle.properties,v
 <--  Bundle.properties
new revision: 1.11; previous revision: 1.10
done
RCS file:
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/ExitDialog.java,v
done
Checking in src/org/netbeans/modules/project/ui/ExitDialog.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/ExitDialog.java,v
 <--  ExitDialog.java
initial revision: 1.1
done
RCS file:
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java,v
done
Checking in src/org/netbeans/modules/project/ui/ProjectUtilities.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/ProjectUtilities.java,v
 <--  ProjectUtilities.java
initial revision: 1.1
done
Processing log script arguments...
More commits to come...
Checking in src/org/netbeans/modules/project/ui/actions/CloseProject.java;
/cvs/projects/projectui/src/org/netbeans/modules/project/ui/actions/CloseProject.java,v
 <--  CloseProject.java
new revision: 1.4; previous revision: 1.3
done
Comment 4 Jesse Glick 2004-05-11 16:35:30 UTC
Right, this approach makes sense I think.
Comment 5 Marian Mirilovic 2005-12-14 16:46:52 UTC
verified