EMF Forms 1.8.0 Feature: Ecore Editor Reloaded

EMF Forms 1.8.0 Feature: Ecore Editor Reloaded

With Mars.2, we release EMF Forms 1.8.0. EMF Forms makes it really simple to create forms that edit your data, based on an EMF model. To get started with EMF Forms please refer to our getting started tutorial. In this post, we want to outline one of the new features: a new version of the Ecore editor based on EMF Forms. We will also have a talk on EclipseCon North America 2016 about it. Along with the new version of the standard Ecore editor, we also provide a generic editor to be used with your custom model, an alternative for the “generated editor”.

Ecore Editor

Most of the developers who use EMF have used the good-old default Ecore editor:

image06

While there are other tools such as the graphical Ecore Tools or Xcore to create models, the tree-based editor is still extremely beneficial. It is simple to use and allows you to specify models fairly efficiently. However, the implementation is over 10 years old and hasn’t received much “love” since then. EMF Forms was created to build form-based UIs based on existing EMF data models. Those forms are often used in editors, which allow the modification of models. Luckily, there is an EMF model for Ecore itself, that means, Ecore itself is just another EMF model. Therefore, we were able to use the full power of EMF Forms to build a new version of the standard Ecore editor:

image01

As you can see, we got rid of the properties view and combined the tree and the properties in one editor. We ordered the properties by importance (instead of the former alphabetical order), grouped them, and combined some fields, such as lower and upper bounds. Where it made sense, we added custom controls, e.g. to support auto-completion. Finally, we added shortcuts and dialogs for the creation of new elements. This enables you to specify a model without leaving the keyboard and therefore, improves efficiency.

image02

Of course an Ecore editor does not make much sense without a Genmodel editor, therefore we reworked this as well:

image03

Both editors are unfortunately not yet part of an Eclipse package, but they are part of the EMF Client Platform 1.8.0 release. Please see this tutorial on how to install and how to use them.

As the implementation of both editors shares most of the code, we even went step further and also implemented a completely generic editor, which is capable of opening any kind of custom model. This editor is described in the following section.

Generic Editor

Another tool that is frequently used by EMF developers is the generated editor. It allows you to create instances of a given EMF model and thereby provides an easy way of testing a defined model. As the Ecore editor, the generated editor has room for improvement. It was initially only meant as a simple code example. It lacks extensibility and adaptability and is therefore, not a very good starting point for the implementation of a custom editor. To get around this, we also provide a generic editor based on EMF Forms, which works with any custom model. It supports features such as loading/saving, DnD, and undo out of the box. Further it uses EMF Forms for rendering, so you can adapt the controls and layouts used in the detail views as you wish. To make that clear: It provides you with a fully functional Eclipse editor for creating and modifying instances of your custom model, without any coding, code generation, or adaptation!

image00

All three editors, the Ecore editor, the Genmodel editor and the generic editor are currently under active development and will be contributing to Neon. If you are interested in trying them out, please follow this tutorial. Please provide feedback by submitting bugs or feature requests or contact us if you are interested in enhancements or support.

If you want to see these editors live in action, join us on EclipseCon North America and join our talk about them.

3 Comments
  • Jan
    Posted at 15:16, 2016-02-13

    In addition to the incredible slow editing speed and switches between mouse and keyboard, what is bugging me most in the old tool is that it lacks some very important information when browsing a model
    – the name of the EClass of an object. You have to guess that from the icon.
    – the name of the containment reference an EObject is contained in. There is actually not even a hint for that.
    Have you addressed this?

    • Posted at 09:39, 2016-02-15

      Hi,

      I think you are talking about the generated/generic editor, do you? If so, isn’t the EClass part of the default label provider?
      The containing reference is often shown as a “folder” below the parent. This could be done by adapting the default content provider.
      Maybe I do not correctly understand your question?

  • Erdal Karaca
    Posted at 16:33, 2016-02-29

    Do you know if the E4 application model can be edited using the generic EMF Forms editor?