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.
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.
*** Issue 42241 has been marked as a duplicate of this issue. ***
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.
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
Right, this approach makes sense I think.
verified