Bug 570471 - E4 Perspective and Part State Persistence Utility
Summary: E4 Perspective and Part State Persistence Utility
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.19   Edit
Hardware: PC All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-19 04:38 EST by Lucas Koehler CLA
Modified: 2022-08-16 06:04 EDT (History)
9 users (show)

See Also:


Attachments
Initial code (unfinished) (81.92 KB, application/zip)
2021-01-19 04:38 EST, Lucas Koehler CLA
no flags Details
Initial code with slight improvements (unfinished) (83.20 KB, application/zip)
2021-01-19 09:17 EST, Lucas Koehler CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Koehler CLA 2021-01-19 04:38:55 EST
Created attachment 285311 [details]
Initial code (unfinished)

Provide a utility to persist and restore perspectives in E4 applications including the parts' states.
Provide a utility to migrate persisted e3 perspectives.

This is not a finished implementation but could potentially be contributed in the future if there is interest for this.

The attachment serves as publishing the existing code as EPL v2.
Comment 1 Lars Vogel CLA 2021-01-19 05:38:18 EST
Sounds good, is it planned to use this also in the IDE for configuring perspectives?
Comment 2 Jonas Helming CLA 2021-01-19 08:29:00 EST
At the moment it is targeted to provide the feature set via an API so that you integrate it into a custom Eclipse 4 application. If the IDE wants to pick this up, that is fine, but we have currently no plans to integrate it into the IDE
Comment 3 Lucas Koehler CLA 2021-01-19 09:17:17 EST
Created attachment 285314 [details]
Initial code with slight improvements (unfinished)

So far it is only planned as a utility.
Slightly improved version of the code.
Comment 4 Wim Jongman CLA 2021-01-19 11:19:38 EST
(In reply to Lucas Koehler from comment #3)
> Created attachment 285314 [details]
> Initial code with slight improvements (unfinished)
> 
> So far it is only planned as a utility.
> Slightly improved version of the code.

Lucas, can you please put this in a Gerrit?
Comment 5 Jonas Helming CLA 2021-01-20 04:27:34 EST
@Wim: We will eventually move this to Gerrit when we get closer to a contributable state. So please consider this BR as a pre-publish of the current state on the road to a contribution.
Comment 6 Jonas Helming CLA 2021-01-20 04:27:45 EST
@Wim: We will eventually move this to Gerrit when we get closer to a contributable state. So please consider this BR as a pre-publish of the current state on the road to a contribution.
Comment 7 Wim Jongman CLA 2021-01-21 06:29:33 EST
Would it be possible to "reset" the perspective with fresh data from the e4xmi, or is this working from the persisted model?
Comment 8 Jonas Helming CLA 2021-07-30 07:22:34 EDT
We finished the integration of this migration helper in a second project now. The migration for sure does not yet cover all cases, but it would probably be of great help for anybody who needs to migrate persisted state. We would like to contribute this as a stand-alone features, i.e. not part of the platform or IDE distribution. It will essentially provide API to do the migration which allows to integrate the migration into any product.

Any opinions about this?
Comment 9 Eclipse Genie CLA 2021-09-23 15:45:38 EDT
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.ui/+/185779
Comment 10 Mickael Istria CLA 2021-09-24 04:19:09 EDT
(In reply to Jonas Helming from comment #8)
> We would like to contribute this as a stand-alone features, i.e. not part of
> the platform or IDE distribution. It will essentially provide API to do the
> migration which allows to integrate the migration into any product.

I'm not really enthusiast about Platform providing some API it has no use for at the moment. It basically means we increase maintenance cost without increasing the value of the SDK, nor actually increase the API value for the mass (as so far this is not a popular request).
IMO, to merge it into Platform, we need at least 1 for the following criteria to be fulfilled:
* The code is profitable and used for the SDK (can be in JDT or PDE as well) and its users
* This is a popular issue/request from multiple RCP providers; popular enough to consider it's an important criterion of success for RCP development and hence we can include it in Platform.

Note that I'm not judging about how useful it is; I sincerely don't know and trust it is at least very useful to you. But if you can find some other interested customers for this feature; it will facilitate its inclusion in Platform.
Comment 11 Wim Jongman CLA 2021-09-24 05:07:18 EDT
(In reply to Mickael Istria from comment #10)

Should it go to PDE?
Comment 12 Jonas Helming CLA 2021-09-24 05:45:25 EDT
We have already used this for several projects that needed this and I expect more to come. This is the reason we initially published the code under EPL so that it can be reused by multiple adopters. Please be aware that especially in the RCP area, many tools are not even yet migrated to 4.x.
Please also be aware that we contribute this as a proxy for several adopting parties.
Comment 13 Wim Jongman CLA 2021-09-24 07:00:09 EDT
(In reply to Jonas Helming from comment #12)
> We have already used this for several projects that needed this and I expect
> more to come. This is the reason we initially published the code under EPL
> so that it can be reused by multiple adopters. Please be aware that
> especially in the RCP area, many tools are not even yet migrated to 4.x.
> Please also be aware that we contribute this as a proxy for several adopting
> parties.

Yes, this is a major issue for all E4 RCP clients. Including us.
Comment 14 Mickael Istria CLA 2021-09-24 07:18:29 EDT
(In reply to Wim Jongman from comment #11)
> Should it go to PDE?

Who's the final user of this feature and when is it used (by use, understand "run" here)?


Would it be possible to include an example together with this contribution; or to reuse those APIs in an existing example?
Comment 15 Jonas Helming CLA 2021-09-27 03:57:11 EDT
There are two use cases:

- Save and restore: This can be used in any RCP application that wants to allow users to persist and load perspectives. Please note that perspectives are not necessarily stored locally, but might be stored in a data base. The API allows this flexible use case.

- Migrate 3.x workbench states to Eclipse 4: This can be used when a project that offered persist perspectives on 3.x wants to migrate the user data from 3.x to Eclipse 4. So this is relevant only at the time when migrating to 4.x
Comment 16 Mickael Istria CLA 2021-09-27 05:23:04 EDT
(In reply to Jonas Helming from comment #15)
> Please note that perspectives
> are not necessarily stored locally, but might be stored in a data base. The
> API allows this flexible use case.

Is this (non local file backend) something you're using? If there is no need for flexibility, let's avoid it in Platform; that will be less APIs to care about for 20 more years.
 
> - Migrate 3.x workbench states to Eclipse 4: This can be used when a project
> that offered persist perspectives on 3.x wants to migrate the user data from
> 3.x to Eclipse 4. So this is relevant only at the time when migrating to 4.x

OK, so it should be part of the "compatibility" part, shouldn't it?

Can both features be decoupled; so one would be in Platform UI, and the other would be in e4 compatibilty parts?
Comment 17 Jonas Helming CLA 2021-09-27 06:53:47 EDT
(In reply to Mickael Istria from comment #16)
> (In reply to Jonas Helming from comment #15)
> > Please note that perspectives
> > are not necessarily stored locally, but might be stored in a data base. The
> > API allows this flexible use case.
> 
> Is this (non local file backend) something you're using? If there is no need
> for flexibility, let's avoid it in Platform; that will be less APIs to care
> about for 20 more years.

I think my description was not clear. The contribution does not provide any API to store in files, data bases or anything. It just operates on Strings. Any adopter can implement the persistence as they want. So the API is very minimal.

>  
> > - Migrate 3.x workbench states to Eclipse 4: This can be used when a project
> > that offered persist perspectives on 3.x wants to migrate the user data from
> > 3.x to Eclipse 4. So this is relevant only at the time when migrating to 4.x
> 
> OK, so it should be part of the "compatibility" part, shouldn't it?
> 
> Can both features be decoupled; so one would be in Platform UI, and the
> other would be in e4 compatibilty parts?

Yes, sounds like a good idea!
Comment 18 Eugen Neufeld CLA 2021-10-29 10:10:22 EDT
I double checked the code and its internal dependencies.
Both parts namely the Save and Restore for e4 applications as well as the Migration from 3.x to e4 are using the same internal model to describe the workbench state. 
Of course we could remove the functionality that requires it (storing e4 Perspective back as 3.x compatible state) or duplicate the model.
But in any other case the compatibility package (org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/e4/compatibility ?) would have a dependency to the new bundle.

Because of this quite tight coupling I suggest to keep this a one bundle.

Maybe I totally misunderstood your suggestion where to add the new bundle to and how to split the code?
Comment 19 Eugen Neufeld CLA 2022-01-31 07:15:19 EST
I split the code, I hope the naming makes sense for you.
A feedback to the split and naming would be very welcome.