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 179526 - Ability for PERSISTENCE_NEVER windows to reopen in last-used Mode
Summary: Ability for PERSISTENCE_NEVER windows to reopen in last-used Mode
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: PC All
: P3 normal (vote)
Assignee: _ tboudreau
URL:
Keywords: API, API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2010-01-14 21:58 UTC by _ tboudreau
Modified: 2010-01-24 08:42 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Patch adding org.openide.windows.RetainLocation annotation (8.07 KB, patch)
2010-01-15 00:43 UTC, _ tboudreau
Details | Diff
Patch adding org.openide.windows.RetainLocation annotation (including apichanges & spec version update) (10.26 KB, patch)
2010-01-15 00:46 UTC, _ tboudreau
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2010-01-14 21:58:35 UTC
A long standing problem with the post 3.6 Window System is that people are confused when they use PERSISTENCE_NEVER on a TopComponent which was created with a Mode and docking information by a wizard, but on restart or after first close, always opens in the editor area.

I'm attaching a small patch which solves this problem very simply using NbPreferences, and will have no effect on existing components.

It adds one annotation - org.openide.windows.RetainLocation("defaultModeName").  A component with this annotation does not need to have any XML or SFS registration.  

A TopComponent annotated with this annotation will look up its last known Mode name in open(), from NbPreferences, and use the default specified in the annotation if none is found.  A trivial patch to core.windows persistence causes temporary modes (but not their contents unless they contain other non-PERSISTENCE_NEVER TopComponents) created by drag-and-drop to be persisted if they contain a component with such an annotation.
Comment 1 _ tboudreau 2010-01-15 00:33:51 UTC
Ugh, the hg diff crashed, and I attached a 0 byte diff, then reverted it.  Will write it again tomorrow...
Comment 2 _ tboudreau 2010-01-15 00:43:31 UTC
Created attachment 93303 [details]
Patch adding org.openide.windows.RetainLocation annotation

Patch implementing this feature - diff is quite small
Comment 3 _ tboudreau 2010-01-15 00:46:39 UTC
Created attachment 93304 [details]
Patch adding org.openide.windows.RetainLocation annotation (including apichanges & spec version update)
Comment 4 _ tboudreau 2010-01-20 11:59:00 UTC
No objections, implementing.

Fixed in main/ 45a604c9bb43
Comment 5 Quality Engineering 2010-01-24 08:42:58 UTC
Integrated into 'main-golden', will be available in build *201001240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/45a604c9bb43
User: Tim Boudreau <tboudreau@netbeans.org>
Log: #179526 - allow persistence type PERSISTENCE_NEVER TopComponents to retain their location across restarts