|
Re: Containers of Contains Behaving Weird [message #663369 is a reply to message #663350] |
Mon, 04 April 2011 19:31 |
|
Hi,
Erik Englund wrote on Mon, 04 April 2011 19:53 | I have created a simple GMF library based off the Library EMF Model. I've modified it such that a library can contain a Library and I created another root object Bookstore that also contains Books.
For one when I create a Diagram based off this model I get lots of duplicate Edit Parts. For example:
LibraryEditPart
Library2EditPart
|
That is normal. You can have different behavior depending on teh container easily.
Erik Englund wrote on Mon, 04 April 2011 19:53 |
Secondly, I get strange behavior whenever I drag a sub library out into the root context. I get two libraries to show up in the root context.
|
It should be a known bugs: https://bugs.eclipse.org/bugs/show_bug.cgi?id=318585
Regards,
Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
|
|
|
|
Re: Containers of Contains Behaving Weird [message #663385 is a reply to message #663377] |
Mon, 04 April 2011 20:03 |
|
Hi,
Erik Englund wrote on Mon, 04 April 2011 21:51 | So then I have a question on best practices. How should I go about customizing the behavior of this edit part. Should I use the edit policy extension point to change its behavior. Or should I override the behavior in each of the generated edit parts by marking them generated not.
|
My point of view is:
- NEVER use @generated NOT
- try to use extension points and providers first
- use GMF aspect templates if there are no extension points available or if the modification occured on every elements of your model.
Erik Englund wrote on Mon, 04 April 2011 21:51 |
My big problem is that in my diagram I want to display as root nodes items that are not directly accessible from the root element of the model. Should I do this by providing my own CanonicalEditPolicy?
|
not sure, but you can take a look to phantom nodes.
Erik Englund wrote on Mon, 04 April 2011 21:51 |
If so how should I register it. I'd prefer to not have to reference any of the VISUAL_ID generated by the tooling since those could possibly change if my model changes.
|
In order to avoid that, you just have to keep the .trace file that is generated.
Regards,
Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
|
|
|
Re: Containers of Contains Behaving Weird [message #663395 is a reply to message #663369] |
Mon, 04 April 2011 20:31 |
|
Aurelien Pupier wrote on Mon, 04 April 2011 21:31 | Hi,
Erik Englund wrote on Mon, 04 April 2011 19:53 | I have created a simple GMF library based off the Library EMF Model. I've modified it such that a library can contain a Library and I created another root object Bookstore that also contains Books.
For one when I create a Diagram based off this model I get lots of duplicate Edit Parts. For example:
LibraryEditPart
Library2EditPart
|
That is normal. You can have different behavior depending on teh container easily.
|
BTW, there is a feature request to don't have this behavior: https://bugs.eclipse.org/bugs/show_bug.cgi?id=332224
Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
|
|
|
Powered by
FUDForum. Page generated in 0.03590 seconds