GMF Editor should use additional notation model [message #202962] |
Thu, 21 August 2008 15:49  |
Eclipse User |
|
|
|
Hi folks.
I'm trying to enhance an existing GMF-Editor. I created a state machine
editor, works fine, Statemachines are beeing saved as *.ssm and
*.ssm_diagram.
No what I want to do, is to put another "layer" over the existing editor
which should be able to edit properties of the editparts, and save them
into another file, e.g. *.ssm_layouthints.
I know there is a post similar to this problem
( news://news.eclipse.org:119/3d7e00c0e937d0562bd95cab0079497f $1@www.eclipse.org),
but in that case everything is stored in the notation model and
therefore the existing editor has to be altered. That is a thing I want
to avoide, because this extra functionality I want to develop is
intended to run with any editor later on. (Not only with the mentioned
state machine editor).
Short explanation what it is going to be:
I want to be able to annotate the editparts, or better the nodes, of a
diagram with special layout hints. E.g. I want to select a bunch of
nodes into a group and annotate this group with the hint "vertical, node
distance 20px". Another group might be annotated with the hint "circle".
All this information will be fed into a layouter which should do the
appropriate rendering according to the hints. As I'm going to develop
this as a plugin which is intended to run with any editor, changes to
the domain and even the notation model should be avoided, as well as to
the editor.
I hope someone can provide me some hints.
Cheers, arne
|
|
|
|
|
Re: GMF Editor should use additional notation model [message #203133 is a reply to message #203119] |
Fri, 22 August 2008 09:43  |
Eclipse User |
|
|
|
Hello Arne,
> post. To clarify it for me (and maybe others). This does mean that I
> have to extent the GMF notation model (http://www.eclipse.org/gmf/runtime/1.0.1/notation).
That means, on
Yes. You have to create your own model extensing Style class from notation
one.
> the other hand, that existing GMF editors compiled against that
> notation model are not going to work any more? Can you confirm/negate.
No. generated code for your notation model extension will be located in a
separate plugin and will have dependency on notation model (not vice versa).
So, as a result you'll not change anything in the generated diagram code/runtime
plugins used by this diagram. Only additional ections (adding this custom
style) will have a dependency to newly generated notation model extension
plugin.
I suggest you trying that.
> Is it maybe possible to use an extension point to add this
> functionality into every GMF editor?
It's not necessary to add anything to GMF. See org.eclipse.gmf.runtime.notation.View.getStyles()
method. I suggest you to create own sybclass of Style interface and use it
while calling View.getStyles().add(myStyleInstance)
In addition EMF is able to generate MyStyle for you if you'll specify "Style"
as a superclass for "MyStyle" EClass inside extension.ecore model.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.03162 seconds