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.
When closing a TopComponent in an Installer extending ModuleInstall as follows: @Override public void close() { Set<TopComponent> openComponents = TopComponent.getRegistry().getOpened(); for (TopComponent tc : openComponents) { tc.close(); } } the method TopComponent.canClose() is called twice if true is returned the first time. Since returning false the second time does not have any visible effect (the TopComponent has been closed anyway) I would rate this behavior as a bug. I created a small module suite project which shows the problem.
Created attachment 52885 [details] Module suite project showing the issue.
reassigning to openide/window system
Confirming this bug as we encounter the same problem with our NetBeans Platform Application. It causes problems with application logic trying to decide whether or not to close the TopComponent. We currently display a "Save, Don't save, Cancel" popup in canClose and the bug causes this to popup twice if anything but cancel is clicked.
fixed bd9a3adffdeb
Integrated into 'main-golden', will be available in build *200812120201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/bd9a3adffdeb User: S. Aubrecht <saubrecht@netbeans.org> Log: #121742 - TopComponent.canClose() called twice.