Community
Participate
Working Groups
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
fixing summary...
An example of my poor mans version can be found at http://www.lemmster.de/blog/index.php/2008/01/18/164/
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.
Created attachment 87499 [details] mylyn/context/zip
(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
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
(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
Created attachment 92934 [details] Revised patch including a testcase which obsoletes the previous patch
Created attachment 92935 [details] mylyn/context/zip
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
Released to HEAD >20080319 PW
changes in IViewDescriptor and views.exsd should be flagged with @since 3.4
(In reply to comment #12) > changes in IViewDescriptor and views.exsd should be flagged with @since 3.4 > Done PW
In I20080325-0100 PW
Markus, you might need to provide a small patch with updated copyright notices (I forgot to check earlier). PW
A patch for all files that I have touched?
Yes please, a patch to update all of the copyright notices for all of the java files you updated. PW
Created attachment 93779 [details] Copyright fixes on top of 92980
(In reply to comment #18) > Created an attachment (id=93779) [details] > Copyright fixes on top of 92980 > Thanx Markus, released >I20080327-0800 PW