Bug 215797 - [ViewMgmt] [WorkbenchParts] Extends org.eclipse.ui.views EP to allow non-restorable views
Summary: [ViewMgmt] [WorkbenchParts] Extends org.eclipse.ui.views EP to allow non-rest...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-01-18 09:14 EST by Markus Kuppe CLA
Modified: 2008-03-27 09:27 EDT (History)
5 users (show)

See Also:


Attachments
preliminary patch handling the basic cases (8.92 KB, patch)
2008-01-22 05:13 EST, Markus Kuppe CLA
no flags Details | Diff
mylyn/context/zip (2.33 KB, application/octet-stream)
2008-01-22 05:13 EST, Markus Kuppe CLA
no flags Details
Revised patch including a testcase which obsoletes the previous patch (16.24 KB, patch)
2008-03-19 12:50 EDT, Markus Kuppe CLA
no flags Details | Diff
mylyn/context/zip (3.64 KB, application/octet-stream)
2008-03-19 12:50 EDT, Markus Kuppe CLA
no flags Details
non restorable views v03 (13.89 KB, patch)
2008-03-19 20:11 EDT, Paul Webster CLA
no flags Details | Diff
Copyright fixes on top of 92980 (5.61 KB, patch)
2008-03-27 06:35 EDT, Markus Kuppe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Kuppe CLA 2008-01-18 09:14:38 EST
Hi,

some use cases (e.g. a view showing a dynamic resource which might not be present after restart anymore) require views to not be restored to their previous state during workbench restart. Unfortunately it's not possible to exclude a given view from being restored or set to be hidden. It's either all or none. Thus adding one additional (boolean) flag to the current org.eclipse.ui.views EP which defines a view to become hidden during restart seems reasonable.

Regards
Markus
Comment 1 Markus Kuppe CLA 2008-01-18 09:15:45 EST
fixing summary...
Comment 2 Markus Kuppe CLA 2008-01-18 09:21:24 EST
An example of my poor mans version can be found at http://www.lemmster.de/blog/index.php/2008/01/18/164/
Comment 3 Markus Kuppe CLA 2008-01-22 05:13:42 EST
Created attachment 87498 [details]
preliminary patch handling the basic cases

This patch prevents views from being saved in the IMemento during shutdown, with the exception of detached and stacked views which arent't handled yet.
Comment 4 Markus Kuppe CLA 2008-01-22 05:13:45 EST
Created attachment 87499 [details]
mylyn/context/zip
Comment 5 Paul Webster CLA 2008-01-24 14:49:36 EST
(In reply to comment #3)
> Created an attachment (id=87498) [details]
> preliminary patch handling the basic cases

Looks good.  Some comments:

I wouldn't add the method to IViewReference, but add a helper method to ViewReference that can be used.  Also, I'd check that it returns a descriptor, just to be safe.

ViewFactory should not save the view state if it is not persistable either.

PW
Comment 6 Markus Kuppe CLA 2008-01-29 05:35:14 EST
Hi Paul, 

what are the scenarios when there is no ViewDescriptor for a given ViewReference? I'm tempted to keep the ViewDescription in the ViewReference.

"ViewFactory should not save the view state if it is not persistable either" means if the IViewReference isn't restorable?

Cheers
Markus
Comment 7 Paul Webster CLA 2008-01-31 09:02:56 EST
(In reply to comment #6)
> Hi Paul, 
> 
> what are the scenarios when there is no ViewDescriptor for a given
> ViewReference? I'm tempted to keep the ViewDescription in the ViewReference.

either an error or during a plugin unloading might kill the view descriptor.


> 
> "ViewFactory should not save the view state if it is not persistable either"
> means if the IViewReference isn't restorable?

If the view (or view reference if it hasn't been instantiated) isn't persistable then don't write out any information for that view when the view factory is doing its saveState(*) call.

Also, you can add a some session tests to make sure that your view doesn't re-appear and never gets called with an IMemento.  Check out org.eclipse.ui.tests.session.ArbitraryPropertiesViewTest for an example of confirming view state across sessions.

PW

Comment 8 Markus Kuppe CLA 2008-03-19 12:50:30 EDT
Created attachment 92934 [details]
Revised patch including a testcase which obsoletes the previous patch
Comment 9 Markus Kuppe CLA 2008-03-19 12:50:34 EDT
Created attachment 92935 [details]
mylyn/context/zip
Comment 10 Paul Webster CLA 2008-03-19 20:11:43 EDT
Created attachment 92980 [details]
non restorable views v03

The tests run, and I've removed the API from IViewReference (and changed IViewDescriptor to isRestorable()).

If you're OK with this, Markus, I'll get this in for the warm up build tomorrow.

PW
Comment 11 Paul Webster CLA 2008-03-19 22:01:33 EDT
Released to HEAD >20080319
PW
Comment 12 Sebastian Davids CLA 2008-03-24 13:35:47 EDT
changes in IViewDescriptor and views.exsd should be flagged with @since 3.4
Comment 13 Paul Webster CLA 2008-03-24 13:41:37 EDT
(In reply to comment #12)
> changes in IViewDescriptor and views.exsd should be flagged with @since 3.4
> 

Done
PW


Comment 14 Paul Webster CLA 2008-03-25 13:54:33 EDT
In I20080325-0100
PW
Comment 15 Paul Webster CLA 2008-03-25 14:29:05 EDT
Markus, you might need to provide a small patch with updated copyright notices (I forgot to check earlier).

PW
Comment 16 Markus Kuppe CLA 2008-03-27 00:30:17 EDT
A patch for all files that I have touched?
Comment 17 Paul Webster CLA 2008-03-27 05:42:26 EDT
Yes please, a patch to update all of the copyright notices for all of the java files you updated.

PW
Comment 18 Markus Kuppe CLA 2008-03-27 06:35:44 EDT
Created attachment 93779 [details]
Copyright fixes on top of 92980
Comment 19 Paul Webster CLA 2008-03-27 09:27:27 EDT
(In reply to comment #18)
> Created an attachment (id=93779) [details]
> Copyright fixes on top of 92980
> 

Thanx Markus, released >I20080327-0800
PW