P2 update dialog for E4 application [message #1863381] |
Tue, 30 January 2024 06:07  |
Eclipse User |
|
|
|
I have done a lot of research into the update functionality for e4 applications and, as far as I was able to discover, there are a couple plugins if you want to use the default update functionality provided by RCP.
If you want to reuse the UI there is the org.eclipse.equinox.p2.ui plugin which you can reuse for the InstallWizard or UpdateWizard, for example. However, this plugin has a dependency on PlatformUI and Activators, which are not part of e4, so for a pure e4 you cannot use it.
However in a pure e4 you can use the core operations from org.eclipse.equinox.p2.core, which basically allow you to make a headless update, without using any update dialog.
So I was wondering why is there no dialog for an e4 app? Is it not possible, for example, to copy the contents from org.eclipse.equinox.p2.ui in another plugin project and remove the old eclipse 3 dependencies and replace them with e4 functionality? Are there some dependencies or functionality that cannot be satisfied in e4 that prevents this plugin from being updated?
I would like to know if any of you have experience trying this approach. I don't want to start migrating the whole org.eclipse.equinox.p2.ui classes just to find at the middle of the road that I cannot convert it to an e4 app.
|
|
|
Re: P2 update dialog for E4 application [message #1863569 is a reply to message #1863381] |
Sun, 11 February 2024 04:43   |
Eclipse User |
|
|
|
Hi,
The update application UI dialogs have not been migrated to a pure E4 approach. All the core plugins are totally compliant (as there is no UI inside). For some of the UI plugins this is not the case. If you have a look on jdt.ui for instance, everything is, unfortunately, still written in the E3 style (view extensions, no injection ...). Nevertheless the compatibility layer will do the job to convert these E3 paradigm into E4 model elements.
Having a PURE e4 application (ie : no dependency at all on org.eclipse.ui), is difficult to achieve as there are unfortunately some pieces of code that are not migrated. It could be possible for a totally new application that will not use the basic ui core components of Eclipse RCP (like p2.ui, console view or other basic views)...
But what you can do is to migrate your main UI plugins in the pure E4 way : no dependency to org.eclipse.ui for this plugin, pure E4 views and editors, injection usage, ...
Then you must admit that some of your plugins will still be sticked on org.eclipse.ui and be handled by the compatibility layer. In this case your application starter must be still written in the E3 way (that will start the compatibility layer).
Try to use the E4 spies and you will see that both E3 and E4 components are totally miscibles (you can for instance define a E4 perspective that will use E3 views), and that's fine like this.
So you should focus on migrating your main UI components and reduce your objective to get a total full E4 migrated application (because you are still using, indirectly, UI E3 components).
|
|
|
Re: P2 update dialog for E4 application [message #1863595 is a reply to message #1863569] |
Wed, 14 February 2024 09:33  |
Eclipse User |
|
|
|
Hi Olivier,
Thank you for your knowledgeable answer. In my case the application was started from the beginning as an e4 app so I don't have any dependencies on org.eclipse.ui. What I wanted was to just use the InstallNewSoftware dialog so I won't have to rewrite all the code, since I have little experience with p2 updates. Modifying the application to use to compatibility layer only for a dialog was not a good option in my opinion.
So in the end I still copied the code from the p2.ui plugin and removed org.eclipse.ui dependencies. Indeed some functionalities, like the copy action, InstalledSoftwarePage and RevertProfilePage, I did not migrate, as I had some troubles with them and honestly, I don't need them at this moment.
Finally, if someone else might need this dialog as well, I have decided to make the git repository public. You can find the code here: https://github.com/grozadanut/ro.linic.ui/tree/main/ro.linic.ui.p2
PS: As I was browsing the code I found another way to add initial repositories, by adding two system properties, this method not being documented anywhere, as I struggled in the past searching for a way to add initial update site, the only method talked about online was to add the p2.inf touchpoint advice file next to the product. But if you want to add different sites at runtime based on the deployed location, you can add the eclipse.p2.artifactRepository and eclipse.p2.metadataRepository properties to the exported product configuration/config.ini file and put the initial update sites as comma separated values for each property.
[Updated on: Sun, 23 June 2024 14:55] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.21771 seconds