Home » Modeling » EMF » Issue with EMF editors and multiple genmodels/plugins (ChildCreationExtenders)
Issue with EMF editors and multiple genmodels/plugins (ChildCreationExtenders) [message #722087] |
Sun, 04 September 2011 11:31 |
jakob Messages: 5 Registered: July 2011 |
Junior Member |
|
|
Edit: The two following posts better describe the actual example that I'm having problems with.
Hello,
First, excuse the URLs in the post. I havn't posted enough messages on this forum to be able to use links and images in my posts. Therefore, to see the images, manually insert www. in front of the URL.
I have an issue with EMF, when I try to generate code from different .genmodels to different plugins, and then try to generate editors which work with all the generated plugins.
I can get it to work in some cases, but there seems to be some bugs which make it impossible to do the way I want to.
First, let me describe an example that works. I have the following genmodel (based on an .ecore-model):
student.dtu.dk/~s062399/coreworks.PNG
This an abstract Element class, and a Folder, which is an Element, and can contain a list of Elements. When I generate code from this, I get as expected an editor, where I can create folders within folders.
I have set the property Extensible Provider Factory to true, so that I can extend this model in other models.
I then have another genmodel, which defines another type of Element (an Item):
student.dtu.dk/~s062399/specworks.png
As you can see, I have set Child Creation Extenders to true, so when I generate the model and edit for this genmodel, I get the ability to also create Items within Folders in my editor.
So far, so good.
The issue comes when I move the Folder into a package of its own. The first genmodel then becomes this:
student.dtu.dk/~s062399/coreworksnot.PNG
The second genmodel (with items) is not changed.
Now, when I generate all the code and start the application, in the generated editor, I can only create folders, and not Items.
I don't know if this is related to bug 274884 (bugs.eclipse.org/bugs/show_bug.cgi?id=274884), but I cannot get the workaround described in that bugreport to work.
Has anyone experienced this or something similar, and come up with a solution? Any help or comments would be much appreciated.
[Updated on: Sun, 04 September 2011 12:11] Report message to a moderator
|
|
| | |
Re: Issue with EMF editors and multiple genmodels/plugins (ChildCreationExtenders) [message #722143 is a reply to message #722087] |
Sun, 04 September 2011 16:12 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
I'd need an example that I didn't need to create from a description.
I.e., minimally the Ecore files involved. It wouldn't suprise me if the
issue is caused purely by nested packages; I very much dislike them
(syntactic rat poison) because there's always yet another problem
specific to them. Can you reproduce the problem without nested packages
involved? If not, I suggest you use that approach instead.
On 04/09/2011 4:31 AM, jakob wrote:
> Hello,
>
> First, excuse the URLs in the post. I havn't posted enough messages on
> this forum to be able to use links and images in my posts. Therefore,
> to see the images, manually insert www. in front of the URL.
>
> I have an issue with EMF, when I try to generate code from different
> .genmodels to different plugins, and then try to generate editors
> which work with all the generated plugins.
>
> I can get it to work in some cases, but there seems to be some bugs
> which make it impossible to do the way I want to.
>
> First, let me describe an example that works. I have the following
> genmodel (based on an .ecore-model):
> student.dtu.dk/~s062399/coreworks.PNG
>
> This an abstract Element class, and a Folder, which is an Element, and
> can contain a list of Elements. When I generate code from this, I get
> as expected an editor, where I can create folders within folders.
>
> I have set the property Extensible Provider Factory to true, so that I
> can extend this model in other models.
>
> I then have another genmodel, which defines another type of Element
> (an Item):
> student.dtu.dk/~s062399/specworks.png
> As you can see, I have set Child Creation Extenders to true, so when I
> generate the model and edit for this genmodel, I get the ability to
> also create Items within Folders in my editor.
>
> So far, so good.
>
> The issue comes when I move the Folder into a package of its own. The
> first genmodel then becomes this:
> student.dtu.dk/~s062399/coreworksnot.PNG
>
> The second genmodel (with items) is not changed.
>
> Now, when I generate all the code and start the application, in the
> generated editor, I can only create folders, and not Items.
>
> I don't know if this is related to bug 274884
> (bugs.eclipse.org/bugs/show_bug.cgi?id=274884), but I cannot get the
> workaround described in that bugreport to work.
>
> Has anyone experienced this or something similar, and come up with a
> solution? Any help or comments would be much appreciated.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Issue with EMF editors and multiple genmodels/plugins (ChildCreationExtenders) [message #722145 is a reply to message #722143] |
Sun, 04 September 2011 17:23 |
jakob Messages: 5 Registered: July 2011 |
Junior Member |
|
|
Thank you for your response, Ed.
Attached is a zip with two .ecore models and the two .genmodels created from these.
I have removed nested packages, so in the core model, it's three packages on the same level, one containing abstract class Element, one containing abstract class Group (supertype Element, and has a reference to Element) and one containing class Folder (supertype Group).
In the second model (specification.ecore), it's just a class Item (supertype Element), which is the one to be included in the editor.
A thing to note is that if Folder and Group are in the same package, it works, but if they are in different packages, it doesn't. No matter if they are in the same package or not, in the provider adapter factory for the Item-class, a GroupChildCreationExtender is created. I'm wondering if this is the problem, since Group is the abstract class, and Folder is the class being instantiated in the editor.
-
Attachment: model.zip
(Size: 2.22KB, Downloaded 134 times)
|
|
|
Re: Issue with EMF editors and multiple genmodels/plugins (ChildCreationExtenders) [message #722738 is a reply to message #722145] |
Tue, 06 September 2011 15:29 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
The second declaration (for the folder package) is missing form the
plugin.xml for the extender.<br>
<br>
<small> <extension
point="org.eclipse.emf.edit.childCreationExtenders"><br>
<extender<br>
uri="group"<br>
class="specification.provider.SpecificationItemProviderAdapterFactory$GroupChildCreationExtender"/><br>
<extender<br>
uri="folder"<br>
class="specification.provider.SpecificationItemProviderAdapterFactory$GroupChildCreationExtender"/><br>
</extension></small><br>
<br>
Please open a bugzilla with your example and as a workaround add
that declaration manually.<br>
<br>
<br>
On 04/09/2011 10:23 AM, jakob wrote:
<blockquote cite="mid:j40bhh$22i$1@news.eclipse.org" type="cite">
<pre wrap="">Thank you for your response, Ed.
Attached is a zip with two .ecore models and the two .genmodels created from these.
I have removed nested packages, so in the core model, it's three packages on the same level, one containing abstract class Element, one containing abstract class Group (supertype Element, and has a reference to Element) and one containing class Folder (supertype Group).
In the second model (specification.ecore), it's just a class Item (supertype Element), which is the one to be included in the editor.
A thing to note is that if Folder and Group are in the same package, it works, but if they are in different packages, it doesn't. No matter if they are in the same package or not, in the provider adapter factory for the Item-class, a GroupChildCreationExtender is created. I'm wondering if this is the problem, since Group is the abstract class, and Folder is the class being instantiated in the editor.
</pre>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Thu Apr 25 12:12:43 GMT 2024
Powered by FUDForum. Page generated in 0.03746 seconds
|