| Summary: | [EAP] No way to store UI-State like in 3.x with IMemento | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Thomas Schindl <tom.schindl> | ||||||||
| Component: | UI | Assignee: | Thomas Schindl <tom.schindl> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | bsd, daniel_megert, emoffatt, Lars.Vogel, ob1.eclipse, pwebster, remy.suen | ||||||||
| Version: | 4.2 | ||||||||||
| Target Milestone: | 4.2 M6 | ||||||||||
| Hardware: | PC | ||||||||||
| OS: | Mac OS X - Carbon (unsup.) | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 348069 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Thomas Schindl
Created attachment 210806 [details]
Annotation
Created attachment 210807 [details]
Modification to PartRenderingEngine
> b) call it in the ContributedPart renderer in disposeWidget
>
Better position is in the PREngine
Any feedback on the API and functional spec would be appreciated Is @PersistState really different from @Persist? Perhaps @PreDestroy should be fixed to happen before the widgets a destroyed? I'm wondering if the contribution object should be conceptually considered as part of the rendering, and should be keeping the model up to date anyways. Yes - it differs a lot from @Persist @Persit == Persit content @PersitState == Persist UI-state e.g. scrolling position, ... I'm not sure we can dispose the context before the widget gets destroyed. Created attachment 210922 [details]
revised patch
Patch to execute the save before the dispose happens.
@Brian: I don't think we can use @PreDestroy because at the moment the context is destroyed all services have are unjected, widgets destroyed (by going through the renderers), ... . @PreDestroy can guarantee that the widget that got injected is not already disposed at the moment the context is destroyed whereas @PersistState does this.
We could though discuss the naming of the annotation my PersistUIState is better?
We decided to go with @PersistState - we also discussed if this could be solved using events but thought @PersistState aligns nicely with @Focus and @Persist so that it makes sense to use it's own annotation. We also discussed if @PreDestroy could would be the correct callback but when creating the Part we do: * Create Context * Create Widget * Create PartObject the opposite should be done on tear down so @PreDestory is not the correct callback. The commit is http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=f2a8ce2a9c2725653391ee3326262a984a9fa896 (In reply to comment #7) > Created attachment 210922 [details] > revised patch > > Patch to execute the save before the dispose happens. > > @Brian: I don't think we can use @PreDestroy because at the moment the context > is destroyed all services have are unjected, I'll just note that during @PreDestroy the context has not been destroyed, and I believe it is called before any of the services are uninjected from the object. PW |