Skip to main content



      Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Example implementation of ECPModelElementOpener(Request for example implementation for ECPModelElementOpener suggested in ECP tutorial)
Example implementation of ECPModelElementOpener [message #1776925] Wed, 22 November 2017 15:12 Go to next message
Eclipse UserFriend
Fellow Eclipse fans,

If TLDR then Goto **

I am working on a ECP application which will handle several different data model types (described by EMF), which will require different editors to be opened. After fiddling around trying to tie the different editors to respective model types using "conventional e4 RCP" , I found the ECP platform which gave the desired functionality straight out of the box.

However, many of the attributes and references in the models requires custom controls for viewing and editing. This is described in "Replacing the default editor" and "Customize Editor Control" on the ECP home page https://www.eclipse.org/ecp/documentation.html.

As I several editors already are implemented (as Parts, using @PostContruct), I went for replacing the default editor. I made an implementation of the ECPModelElementOpener, which is executed in place of the default editor. But I am confused about how to build up the new part, as there is no composite or part given as argument to the overridden openModelElement() method. I tried to inject the EPartService, but it is not initialised by the framework (stays null).

So my question is:
**Can someone please provide a (simple) example implementation of the ECPModelElementOpener, which demonstrates the GUI build up and databinding towards the EMF?

Answers much appreciated.

Best regards from Norway,
Jon Dæhlen
Re: Example implementation of ECPModelElementOpener [message #1778471 is a reply to message #1776925] Thu, 14 December 2017 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jon,

sorry for the late answer. First of all, for implemting the viw with EMF and databinding, you should have a look at EMF Forms (emfforms.org)
Second, about the ModelOpener, have you looked at the existing implementation "E4ModelElementOpener"?

Best regards,

Jonas
Re: Example implementation of ECPModelElementOpener [message #1778635 is a reply to message #1778471] Tue, 19 December 2017 02:57 Go to previous messageGo to next message
Eclipse UserFriend
Hi Jonas,

Thanks for the answer.

I agree, EMFForms is probably more suited. It may be just as fast to implement custom control areas for the attributes and references that needs it, rather than adapt the old swt gui to handle EMF, databinding towards it and fit into the ModelElementOpener.

Found this tutorial (https://eclipsesource.com/blogs/tutorials/emf-forms-custom-control-areas/) that seems to describe the methodology pretty well, however I have not had the time to test it yet.


Jon.

Re: Example implementation of ECPModelElementOpener [message #1778643 is a reply to message #1778635] Tue, 19 December 2017 05:02 Go to previous message
Eclipse UserFriend
Hi Jon,

dont go for custom control areas. Rather create a default view model and replace only those renderes, which do not fit your requirements (e.g. some controls).

Best regards,

Jonas
Previous Topic:Select renderer in view model
Next Topic:JavaFX support for ECP
Goto Forum:
  


Current Time: Thu Jun 19 13:01:31 EDT 2025

Powered by FUDForum. Page generated in 0.03843 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top