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 168243 - Closing of projects triggers initialization of new TopComponents
Summary: Closing of projects triggers initialization of new TopComponents
Status: RESOLVED DUPLICATE of bug 168453
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Milan Kubec
URL:
Keywords: PERFORMANCE
: 168244 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-07 18:04 UTC by Marian Petras
Modified: 2009-07-16 10:14 UTC (History)
3 users (show)

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 Marian Petras 2009-07-07 18:04:01 UTC
Closing one or more projects triggers initialization (creation) of all non-existing TopComponents that are declared to
be docked in the editor mode. This may take a long time.

The method that triggers this initialization in in file ProjectUtilities.java, in method doClose() (in an anonymous
inner class):


        private void doClose(Project[] projects, boolean notifyUI, Wrapper wr) {
            //
            // ... (preceding non-essential code) ...
            //
            WindowManager wm = WindowManager.getDefault();
            for (Mode mode : wm.getModes()) {
                if (!wm.isEditorMode(mode)) {
                    continue;
                }
                for (TopComponent tc : mode.getTopComponents()) {
                    //                               ^
                    // this triggers the creation ---|
                }
                //...
            }
        }


I understand the motivation for the above code. I also do not know of any other way of writing it better until the
Window System API provides a method like Mode.getExistingTopComponents(). So I assume that the Window System API needs
to be extended to allow such a call.
Comment 1 Marian Petras 2009-07-07 18:05:51 UTC
*** Issue 168244 has been marked as a duplicate of this issue. ***
Comment 2 Marian Petras 2009-07-09 17:15:35 UTC
Loading, initialization and closing of never-used TopComponents takes approximately 750 ms on my system
(Intel Core 2 Quad @ 3 GHz).
Comment 3 Milan Kubec 2009-07-16 10:14:32 UTC

*** This issue has been marked as a duplicate of 168453 ***