Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Ecore Tools - Graphical editor extension(Extending standard graphical ecore diagram editor)
Ecore Tools - Graphical editor extension [message #1091712] Wed, 21 August 2013 18:08 Go to next message
Han G is currently offline Han G
Messages: 11
Registered: August 2013
Junior Member
Hello,

I'd like to extend/modify the graphical ecore diagram editor provided by Ecore Tools. For example: While hovering over a class attribute it should display the entries of the EAnnotation attached to that attribute (not just "attributes").

I thought this could be done by creating a custom EAttributeEditPart class and use this instead of the default one (just create that class and change the type="VISUAL_ID" property in the *.ecorediag file).

My problem is that I would have to somehow register such a custom class at the EcoreVisualIDRegistry which doesn't seem to accept any extensions.

Is there a way around this (perhaps exchange the registry?) or any other solution for my problem without writing my own ecore diagram editor?

Regards,
han
Re: Ecore Tools - Graphical editor extension [message #1092705 is a reply to message #1091712] Fri, 23 August 2013 01:38 Go to previous messageGo to next message
Ed Merks is currently offline Ed Merks
Messages: 25744
Registered: July 2009
Senior Member
Han,

Sorry the Ecore Tools editor is not designed to be extensible in this way.

On 22/08/2013 12:08 AM, Han G wrote:
> Hello,
>
> I'd like to extend/modify the graphical ecore diagram editor provided
> by Ecore Tools. For example: While hovering over a class attribute it
> should display the entries of the EAnnotation attached to that
> attribute (not just "attributes").
>
> I thought this could be done by creating a custom EAttributeEditPart
> class and use this instead of the default one (just create that class
> and change the type="VISUAL_ID" property in the *.ecorediag file).
>
> My problem is that I would have to somehow register such a custom
> class at the EcoreVisualIDRegistry which doesn't seem to accept any
> extensions.
>
> Is there a way around this (perhaps exchange the registry?) or any
> other solution for my problem without writing my own ecore diagram
> editor?
>
> Regards,
> han
Re: Ecore Tools - Graphical editor extension [message #1196584 is a reply to message #1092705] Tue, 19 November 2013 08:41 Go to previous messageGo to next message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Ed Merks wrote on Fri, 23 August 2013 01:38
Han,

Sorry the Ecore Tools editor is not designed to be extensible in this way.



Hey Ed,

I am also interested in building an extension for the diagram editor. Is there absolutely no way to extend the editor or is there a documented way? I want to analyse a meta model and restructure the visual representation (layout, color encoding etc.) based on the results of the analysis. Is there a way to create a custom build?

I am fairly new to the EMF and Ecore Tools, so I would be very grateful for any hints.

Best regards,

Michael
Re: Ecore Tools - Graphical editor extension [message #1198265 is a reply to message #1196584] Wed, 20 November 2013 03:25 Go to previous messageGo to next message
Peter  is currently offline Peter
Messages: 85
Registered: July 2009
Member
Sure, you can simply modify the code.
Have a look at custom layout providers. For the color you must hook some
where your code that looks at the diagram elements and then set the
color. Depends on what behavior you want.


Am 19.11.2013 15:02, schrieb Michael Lukaszczyk:
> Ed Merks wrote on Fri, 23 August 2013 01:38
>> Han,
>>
>> Sorry the Ecore Tools editor is not designed to be extensible in this
>> way.
>
>
> Hey Ed,
>
> I am also interested in building an extension for the diagram editor. Is
> there absolutely no way to extend the editor or is there a documented
> way? I want to analyse a meta model and restructure the visual
> representation (layout, color encoding etc.) based on the results of the
> analysis. Is there a way to create a custom build?
>
> I am fairly new to the EMF and Ecore Tools, so I would be very grateful
> for any hints.
>
> Best regards,
>
> Michael
Re: Ecore Tools - Graphical editor extension [message #1198638 is a reply to message #1198265] Wed, 20 November 2013 07:32 Go to previous messageGo to next message
Cedric Brun is currently offline Cedric Brun
Messages: 348
Registered: July 2009
Senior Member
Hi,

EcoreTools is actually being reimplemented based on Sirius. This brings a whole new facility for extension.
You might want to have a look here :http://www.eclipse.org/sirius/doc/specifier/diagrams/Diagrams.html

It should now be possible for you to define your diagram extension in your own plugin and to specify an additional Layer on top of the EcoreTools class diagram, contributing new elements to display or new tools.
You should be able to customize the way tooltips are computed for an existing Node/Container in the diagram using a "StyleCustomization" object.
Extension through the GMF runtime extension points are still possible but it doesn't look like you would need it for your use case.
Re: Ecore Tools - Graphical editor extension [message #1198890 is a reply to message #1198638] Wed, 20 November 2013 10:13 Go to previous messageGo to next message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Hey Cedric,

thank you! This looks very promising, but as far as I can see Sirius gives me the opportunity to create an editor for my concrete instance model based on my meta model (Or do I miss something?). I don´t want to work on a concrete instance. Just on my meta model like I do when I use the diagram editor to specify my domain model.

For example:
I have a complex arbitrary *.ecore model with lots of classes. Now I´m running a "model splitting" tool that analyzes the complete meta model and writes the results in a seperate xml file. The algorithm detects which classes have strong relationships to each other. Now I want to reopen my *.ecore diagram with the result.xml as additional input in a generic diagram editor (or just viewer) and visualize the model splittings/couplings by restructure the visual representation of the model based on the results in the xml file.
Is this something I could achieve with Sirius? Or do I have to wait for the next release of ecoreTools? Is the source for the new release available? I wonder how I could achieve my goals without writing a complete new diagram editor. Since I am new to plugin and mdd development I´m a bit lost... Any help would be appreciated.

Thanks in advance,

Michael
Re: Ecore Tools - Graphical editor extension [message #1199012 is a reply to message #1198890] Wed, 20 November 2013 11:34 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles David
Messages: 92
Registered: July 2009
Member
Le 20/11/2013 16:13, Michael Lukaszczyk a écrit :
>
> thank you! This looks very promising, but as far as I can see Sirius
> gives me the opportunity to create an editor for my concrete instance
> model based on my meta model (Or do I miss something?).

A Sirius-based editor is defined relative to a meta-model, and will work
on all instances of that meta-model.

Maybe the confusion is because in most demos and talk we show how you
can define the editor using an example instance to get direct feedback,
but the resulting editor definition will work on any instance of the
same meta-model.
Re: Ecore Tools - Graphical editor extension [message #1199186 is a reply to message #1199012] Wed, 20 November 2013 13:29 Go to previous message
Michael Lukaszczyk is currently offline Michael Lukaszczyk
Messages: 14
Registered: November 2013
Junior Member
Yes, I am aware of that. But I don´t want to build a domain specific editor for one concrete meta model. I want to stay on ecore meta level. I want to build a generic editor that is simply able to handle arbitrary ecore models in a diagram view. Just like the ecore tools diagram editor where you can build uml-style class diagrams. Maybe I can´t describe my intentions right. I´ll Probably have to dig deeper into the whole emf ecosystem. I will also check out Peter´s hints. Thanks for now. More recommendations are welcome =)!
Previous Topic:HOW do you Query for multiple values with Texo/JSON REST Web Services
Next Topic:[EMFStore] Recovery from checksum error
Goto Forum:
  


Current Time: Fri Apr 18 01:38:28 EDT 2014

Powered by FUDForum. Page generated in 0.02611 seconds