ISISComputingGroup / IBEX

Top level repository for IBEX stories
4 stars 2 forks source link

Eclipse 4: Continue migration [TIMEBOX: 8d] #2491

Closed AdrianPotter closed 6 years ago

AdrianPotter commented 6 years ago

For August 2017 sprint. Continue E4 migration. Details to be filled in by Adrian

AdrianPotter commented 6 years ago

I've written some notes on the first stage of migration here:

https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/Eclipse-4-migration-notes

For the 2nd stage of the timeboxed migration we should aim to do the following:

The alarms view

In order to migrate the alarms view we'll need to sort out the following issues:

Please make sure to document how each of these issues were solved. The last one in particular is going to be recurrent.

Edit configuration dialog

This hopefully should be relatively straightforward since the back end only relies on talking to PVs which we know we can do.

The current mock dialog is based on the E4 application model. That migration may involve translating the current dialog tree into the new application mode rather than relying on the existing code. This will be exploratory in nature

Create a proper perspective switcher

As described in the notes, the current perspective switcher uses hard-coded perspectives. It'd be good to get a flexible system in place at an early stage that makes it easy to add new perspectives. There may be multiple ways to do this, either via the E4 application model or by using extension points.

The perspective switcher should also allow users to reset a perspective to its original settings. From reading online, this solution may be available to us since we're using pure E4:

https://www.eclipse.org/forums/index.php/t/457640/

I think this is the solution for an application using compatibility at the front end:

https://stackoverflow.com/questions/19717154/how-do-i-reset-perspective-for-eclipse-e4-rcp-application

AdrianPotter commented 6 years ago

Notes about the view issue from TechTalk:

Hi:

I’m trying to write an Eclipse 4 application using EPICS and CSS.

From inspection of the code, CSS’s views use the Eclipse 3.x compatibility layer; they inherit from ViewPart and call creatPartControl() to build the view. Elements of the Eclipse 4 application model on the other hand use > annotations (i.e. @PostConstruct) to do the same.

If I try and use a CSS ViewPart in my Eclipse 4 application, I typically get nullPointerExceptions where the CSS class tries to access the Eclipse 3.x API (e.g. getSite()). Does anyone have any advice on how I can get around this issue to use CSS views in my Eclipse 4 application?

You can have POD-type contributions with @PostConstruct etc. Just search for @PostConstruct in the CSS sources and you'll find the Clock plugin as an example. (https://github.com/ControlSystemStudio/cs-studio/blob/master/applications/apputil/apputil-plugins/org.csstudio.utility.clock/src/org/csstudio/utility/clock/ClockView.java ) The associated plugin.xml registers that POD as an "e4view" (https://github.com/ControlSystemStudio/cs-studio/blob/master/applications/apputil/apputil-plugins/org.csstudio.utility.clock/plugin.xml#L10).

For what it's worth, the "compatibility layer" is somewhat misnamed. RCP is not going away, E4 is not replacing it. A better way to describe it: E4 is a low-level model-based description of parts, menues etc. which are then rendered by SWT. That's great for building a new standalone browser for your DVD collection, or for a clock. For an application you typically also want online help, preference UI, file navigator, .. That's what RCP adds on top of E4. The "compatibility layer" would better be named "rich application layer" or "workspace and workbench layer". The Eclipse IDE for example will continue to use it. See also "Tips and tricks for your Eclipse 4 migration." on https://www.eclipsecon.org/na2016/conference/session-slides

-Kay

AdrianPotter commented 6 years ago

@John-Holt-Tessella, I'll start working on the alarms view and hopefully in the process figure out how to put CSS views that use the compatibility layer into our E4 application

AdrianPotter commented 6 years ago

This is pretty much done for this timebox. Remaining tasks:

I'm on holiday for a week so if @John-Holt-Tessella, you wanted to pick it up, please do, but it might be tricky without me around to explain. HINT: Almost everything the application needs to know, including what to run on the compatibility layer, is in the e4Xmi.

AdrianPotter commented 6 years ago

Just needs any input from John on:

https://github.com/ISISComputingGroup/ibex_developers_manual/wiki/Eclipse-4-migration-notes

Tom-Willemsen commented 6 years ago

I've had a look at the changes - after some initial setup steps (which I've asked Adrian to put on the wiki) it works.

Things I've looked at:

I've skimmed over the code and it all looks sensible, I haven't had a super-detailed look as most of it is just E4 metadata