Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsSaving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791285/#msg_791285
void IViewPart.saveState(IMemento memento);
I haven't been able to figure out how to replace that in e4. I've tried to save away my private view state like so:
part.getPersistedState().put("mykey", "myvalue")
and then, in a @PostConstruct method to do
part.getPersistedState().get("mykey");
however, I always get back a null value. I've tried to save the state in a @PreDestroy method, which got called, but the put() had no effect. I then tried to put a @PreSave annotation on the method, but in that case, the method didn't even get called.
Any Ideas?
greets, Thomas ]]>Thomas Mäder2012-02-05T15:35:02-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791417/#msg_791417
please have a look at Eclipse 4 and Preferences Tutorial.
I try to describe the usage of Preferences in this tutorial. Let me know if that solves your problem.
Best regards, Lars]]>Lars Vogel2012-02-05T20:00:13-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791741/#msg_791741
not working please file a bug. Just to make sure you don't specify clean
when starting up the next time?
Tom
Am 05.02.12 16:35, schrieb Thomas äder:
> In the 3.x API there was the method
>
> void IViewPart.saveState(IMemento memento);
>
> I haven't been able to figure out how to replace that in e4. I've tried
> to save away my private view state like so:
>
> part.getPersistedState().put("mykey", "myvalue")
>
> and then, in a @PostConstruct method to do
>
> part.getPersistedState().get("mykey");
>
> however, I always get back a null value. I've tried to save the state in
> a @PreDestroy method, which got called, but the put() had no effect. I
> then tried to put a @PreSave annotation on the method, but in that case,
> the method didn't even get called.
>
> Any Ideas?
>
> greets, Thomas]]>Thomas Schindl2012-02-06T07:57:21-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791742/#msg_791742
view - this should be done using the persistedState.
Tom
Am 05.02.12 21:00, schrieb Lars Vogel:
> Hi Thomas,
>
> please have a look at
> http://www.vogella.de/articles/Eclipse4Preferences/article.html.
>
> I try to describe the usage of Preferences in this tutorial. Let me know
> if that solves your problem.
>
> Best regards, Lars]]>Thomas Schindl2012-02-06T07:58:15-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791766/#msg_791766
I've noticed that actually, the save/read mechanism works, but that the widgets are already disposed in the @PreDestroy. But widget state is exactly what I'm trying to save. Is there an earlier callback I can use where the widgets are still there?
Thomas]]>Thomas Mäder2012-02-06T08:33:41-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791790/#msg_791790
Hm - that is not different in 3.x, not? If you try to access the widgets
inside the ViewPart#dispose method they are already disposed.
There's no other event i think. So I guess you'll have to set the value
whenever a widget changes its value, or keep the state in an internal
variable and move it to the persisted state on @PreDestroy.
Tom
Am 06.02.12 09:33, schrieb Thomas äder:
> Thanks Tom,
>
> I've noticed that actually, the save/read mechanism works, but that the
> widgets are already disposed in the @PreDestroy. But widget state is
> exactly what I'm trying to save. Is there an earlier callback I can use
> where the widgets are still there?
>
> Thomas]]>Thomas Schindl2012-02-06T09:01:44-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791833/#msg_791833
Thomas Mäder2012-02-06T10:02:18-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/791869/#msg_791869
shutsdown.
It looks to me we are not having such an event yet which marks a major
regression compared to 3.x views.
I'm not sure why this save is only executed on shutdown and I think we
should more generally provide a callback annotation exectued when the
view closes like @PersitState.
I think it should be exectued in the diposeWidget()-method of a
ContributedPartRender. I guess another option for you until then is to
attach a DisposeListener on the top-level Composite because at this
moment the children are not yet disposed.
Tom
Am 06.02.12 11:02, schrieb Thomas äder:
> Yes, but the widgets were usable in the saveState(...) method, see for
> example the class org.eclipse.ui.views.markers.internal.TableView. If I
> have no callback that still has the widgets available, I'd have to track
> all relevant widget state all the time and keep a copy in my view class.
> I definitely don't want to do that.]]>Thomas Schindl2012-02-06T10:54:38-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792116/#msg_792116
Thomas]]>Thomas Mäder2012-02-06T16:29:22-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792155/#msg_792155
desired thing because doing things a bit different (doing the save not
only on workbench shutdown) would not happen then.
Tom
Am 06.02.12 17:29, schrieb Thomas äder:
> Hmhhhh...I guess I'll just leave that part out for the moment. I humbly
> suggest that only eating your own dogfood (i.e. port the Eclipse SDK to
> nativ e4) will make sure that no essential parts are missing.
>
> Thomas]]>Thomas Schindl2012-02-06T17:20:10-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792699/#msg_792699
Then how are you going to convince anybody that an IDE-class application can be built on top of e4? If you can't convince your own people to port to the e4 API, why should anybody else? I've been working on my little part here for about 4 days and already I've found a pretty glaring functional gap between 3.x and e4. That does not really convince me that e4 will be ready from prime time with the Juno release. Hmhhh...
</rant>]]>Thomas Mäder2012-02-07T09:53:14-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792714/#msg_792714
would pay for this rewrite? I'm not responsible for all those developers
but would be suprised if it will happen.
That's why there's the compat layer providing you exactly this kind of
support.
In the past we made the fault to merge to many functionality into the
Eclipse Code base causing us maintenance nightmare simply because one
product wanted it.
In e4 we are turning this around we provide only minimalistic API at the
e4 level (Model + Service API) but allow you to extend the concepts e.g.
to build something like an IDE (we allow you to extend our Meta-Model to
add new concepts - take a look at the SimpleIDE it the git-repo to see
how one can extend the e4 application model.
As an example for this is that you could solve this very problem by
(though still agree as stated before that this functionality should be
built into the framework):
a) defining your own annotation
b) provide your own ContributedPartRenderer
c) overload the disposeWidget-method and call the annotated method
The main target for E4AP (that's what you called e4) is RCP like
applications and this core modules will never provide more than that.
The next focus could be to work on API above this layer make writing IDE
like applications possible but we simply don't have the resources.
Your attitude of not even filing a bug for missing functionality is not
really help us in this respect.
Final word. I don't expect E4AP provide you all the support you want
when writing an IDE-class applications (e.g. there's no direct support
for editor registration) provided in Juno timeframe and I don't see us
having advertised e4 for IDEs whereas we have for RCP apps.
The missing functionality we are discussing here is something that is
needed for RCP like apps and would have been willing to donate my spare
time to fill the gap but not without minimal help from you on at least
specifying the minimal behavior in a bug report.
Tom
Am 07.02.12 10:53, schrieb Thomas Mäder:
> <rant>
> Then how are you going to convince anybody that an IDE-class application
> can be built on top of e4? If you can't convince your own people to port
> to the e4 API, why should anybody else? I've been working on my little
> part here for about 4 days and already I've found a pretty glaring
> functional gap between 3.x and e4. That does not really convince me that
> e4 will be ready from prime time with the Juno release. Hmhhh...
> </rant>]]>Thomas Schindl2012-02-07T10:18:05-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792750/#msg_792750
Tom Schindl wrote on Tue, 07 February 2012 05:18
Have you ever looked at how big the Eclipse Code base is? Who the hell
would pay for this rewrite? I'm not responsible for all those developers
but would be suprised if it will happen.
Why, IBM, of course
Quote:
As an example for this is that you could solve this very problem by
(though still agree as stated before that this functionality should be
built into the framework):
a) defining your own annotation
b) provide your own ContributedPartRenderer
c) overload the disposeWidget-method and call the annotated method
Thanks, that's helpful
Quote:
Your attitude of not even filing a bug for missing functionality is not
really help us in this respect.
Final word. I don't expect E4AP provide you all the support you want
when writing an IDE-class applications (e.g. there's no direct support
for editor registration) provided in Juno timeframe and I don't see us
having advertised e4 for IDEs whereas we have for RCP apps.
The missing functionality we are discussing here is something that is
needed for RCP like apps and would have been willing to donate my spare
time to fill the gap but not without minimal help from you on at least
specifying the minimal behavior in a bug report.
Dude, I'm not your enemy. I haven't filed a bug because I don't know if it's a bug, missing functionality or just that I don't know what I'm doing. The whole dependency injection/modeled workbench stuff makes the framework less discoverable; you can't just browse along some API. Since a lot of the Javadoce is boilerplate right now ("the meaning of the XXX attribute isn't clear, there really should be more of a description" ), it's not always easy to figure out how it's supposed to work. ]]>Thomas Mäder2012-02-07T11:11:48-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/792777/#msg_792777
and I replied that ranting doesn't help us at all.
We need input - and this input has to be provided through bugzillas the
team can't browse the newsgroup and extract the informations on their own.
If you find missing functionality, documentation ... we are always happy to:
* receive bugzillas
* patches with implementation inside a bugzilla
You can see the missing of a feature a possibility for you to move the
framework into a direction.
Tom
Am 07.02.12 12:11, schrieb Thomas Mäder:
> Tom Schindl wrote on Tue, 07 February 2012 05:18
>> Have you ever looked at how big the Eclipse Code base is? Who the hell
>> would pay for this rewrite? I'm not responsible for all those developers
>> but would be suprised if it will happen.
>
> Why, IBM, of course ;)
>
> Quote:
>> As an example for this is that you could solve this very problem by
>> (though still agree as stated before that this functionality should be
>> built into the framework):
>> a) defining your own annotation
>> b) provide your own ContributedPartRenderer
>> c) overload the disposeWidget-method and call the annotated method
>
>
> Thanks, that's helpful
>
> Quote:
>> Your attitude of not even filing a bug for missing functionality is not
>> really help us in this respect.
>>
>> Final word. I don't expect E4AP provide you all the support you want
>> when writing an IDE-class applications (e.g. there's no direct support
>> for editor registration) provided in Juno timeframe and I don't see us
>> having advertised e4 for IDEs whereas we have for RCP apps.
>>
>> The missing functionality we are discussing here is something that is
>> needed for RCP like apps and would have been willing to donate my spare
>> time to fill the gap but not without minimal help from you on at least
>> specifying the minimal behavior in a bug report.
>
>
> Dude, I'm not your enemy. I haven't filed a bug because I don't know if
> it's a bug, missing functionality or just that I don't know what I'm
> doing. The whole dependency injection/modeled workbench stuff makes the
> framework less discoverable; you can't just browse along some API. Since
> a lot of the Javadoce is boilerplate right now ("the meaning of the XXX
> attribute isn't clear, there really should be more of a description"
> ;)), it's not always easy to figure out how it's supposed to work.]]>Thomas Schindl2012-02-07T11:52:24-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/794647/#msg_794647
https://bugs.eclipse.org/bugs/show_bug.cgi?id=371087
Tom
Am 07.02.12 12:11, schrieb Thomas Mäder:
> Tom Schindl wrote on Tue, 07 February 2012 05:18
>> Have you ever looked at how big the Eclipse Code base is? Who the hell
>> would pay for this rewrite? I'm not responsible for all those developers
>> but would be suprised if it will happen.
>
> Why, IBM, of course ;)
>
> Quote:
>> As an example for this is that you could solve this very problem by
>> (though still agree as stated before that this functionality should be
>> built into the framework):
>> a) defining your own annotation
>> b) provide your own ContributedPartRenderer
>> c) overload the disposeWidget-method and call the annotated method
>
>
> Thanks, that's helpful
>
> Quote:
>> Your attitude of not even filing a bug for missing functionality is not
>> really help us in this respect.
>>
>> Final word. I don't expect E4AP provide you all the support you want
>> when writing an IDE-class applications (e.g. there's no direct support
>> for editor registration) provided in Juno timeframe and I don't see us
>> having advertised e4 for IDEs whereas we have for RCP apps.
>>
>> The missing functionality we are discussing here is something that is
>> needed for RCP like apps and would have been willing to donate my spare
>> time to fill the gap but not without minimal help from you on at least
>> specifying the minimal behavior in a bug report.
>
>
> Dude, I'm not your enemy. I haven't filed a bug because I don't know if
> it's a bug, missing functionality or just that I don't know what I'm
> doing. The whole dependency injection/modeled workbench stuff makes the
> framework less discoverable; you can't just browse along some API. Since
> a lot of the Javadoce is boilerplate right now ("the meaning of the XXX
> attribute isn't clear, there really should be more of a description"
> ;)), it's not always easy to figure out how it's supposed to work.]]>Thomas Schindl2012-02-09T14:32:07-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/797569/#msg_797569
Thomas Mäder2012-02-13T16:51:19-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/797601/#msg_797601
http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f2a8ce2a9c2725653391ee3326262a984a9fa896
So in the next builds you should have support for this new annotation.
Any other feature gaps you noticed?
Tom
Am 13.02.12 17:51, schrieb Thomas Mäder:
> Thanks, Tom.]]>Thomas Schindl2012-02-13T17:25:53-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/802912/#msg_802912
Thomas Mäder2012-02-20T16:48:54-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/809071/#msg_809071
We are providing the Eclipse 4.2 Workbench which includes the standard 3.x workbench services and part of its implementation based on the workbench model+renderers and DI from Eclipse 4.
In 4.3 we'll be looking at making the Eclipse 4 RCP API available. As Tom mentioned we do need feedback in the form of bugs to cover off holes in the Eclipse 4 RCP story.
PW
]]>Paul Webster2012-02-28T12:59:57-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/826845/#msg_826845
Thomas Mäder2012-03-22T15:20:36-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/827471/#msg_827471
But that's just one example. If you use any of the o.e.ui extension points, the Preference dialog, about, the progress view, or anything currently in o.e.ui.ide you would need the 4.2 Workbench.
PW
]]>Paul Webster2012-03-23T11:26:11-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/829481/#msg_829481
Thomas Mäder2012-03-26T10:56:25-00:00Re: Saving Part State
https://www.eclipse.org/forums/index.php/mv/msg/285716/831273/#msg_831273
Brian de Alwis2012-03-28T17:41:48-00:00