Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF Editor Context menu and hierarchical Ecores
EMF Editor Context menu and hierarchical Ecores [message #780988] Thu, 19 January 2012 21:40 Go to next message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 4
Registered: July 2009
Junior Member
Hi all,
I created a hierarchy of model plugins, each one with an Ecore:
- Plugin "myecorebase": defines a base class (MyBaseObject) and a
Container with a collection of MyBaseObject
- Plugin "myecore1": defines a class (Computer) with
ESuperType=MyBaseObject (an extended class)

After launching an Eclipse Application with this two plugins I can
successfully handle a Container.xmi file which represent a Container
with both base class and extended class in its collection:

<?xml version="1.0" encoding="ASCII"?>
<myecorebase:Container xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:myecore1="http://myecore1/1.0"
xmlns:myecorebase="http://myecorebase/1.0">

<products xsi:type="myecorebase:MyBaseObject" name="ModuloA"
description="Scrivania ModuloA"/>
<products xsi:type="myecore1:Computer" name="Processor i3 Dell"
processor="Intel i3" manufacturer="Dell"/>
</myecorebase:Container>

However, just selecting the Container object, the context menu shows
only "New Child-> Products My Base Object". If instead I select the
extended object (Computer), then the same context menu now shows both
actions:
- New Child-> Products My Base Object
- -> Products Computer

so the question is: how can I have both actions available from the
beginning (consider for instance to start with an empty Container)?

Thank you very much
Vincenzo
Re: EMF Editor Context menu and hierarchical Ecores [message #780990 is a reply to message #780988] Fri, 20 January 2012 06:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33113
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Vincenzo,<br>
<br>
Have a look at<a
href="http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html"><br>
</a>
<blockquote><a
href="http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html">http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html</a><br>
</blockquote>
<br>
On 19/01/2012 10:40 PM, Vincenzo Caselli wrote:
<blockquote cite="mid:jfa2jl$1qh$1@news.eclipse.org" type="cite">Hi
all,
<br>
I created a hierarchy of model plugins, each one with an Ecore:
<br>
- Plugin "myecorebase": defines a base class (MyBaseObject) and a
Container with a collection of MyBaseObject
<br>
- Plugin "myecore1": defines a class (Computer) with
ESuperType=MyBaseObject (an extended class)
<br>
<br>
After launching an Eclipse Application with this two plugins I can
successfully handle a Container.xmi file which represent a
Container with both base class and extended class in its
collection:
<br>
<br>
&lt;?xml version="1.0" encoding="ASCII"?&gt;
<br>
&lt;myecorebase:Container xmi:version="2.0"
xmlns:xmi=<a class="moz-txt-link-rfc2396E" href="http://www.omg.org/XMI">"http://www.omg.org/XMI"</a>
xmlns:xsi=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/2001/XMLSchema-instance">"http://www.w3.org/2001/XMLSchema-instance"</a>
<br>
    xmlns:myecore1=<a class="moz-txt-link-rfc2396E" href="http://myecore1/1.0">"http://myecore1/1.0"</a>
<br>
    xmlns:myecorebase=<a class="moz-txt-link-rfc2396E" href="http://myecorebase/1.0">"http://myecorebase/1.0"</a>&gt;
<br>
    
<br>
    &lt;products xsi:type="myecorebase:MyBaseObject"
name="ModuloA" description="Scrivania ModuloA"/&gt;
<br>
    &lt;products xsi:type="myecore1:Computer" name="Processor i3
Dell" processor="Intel i3" manufacturer="Dell"/&gt;
<br>
&lt;/myecorebase:Container&gt;
<br>
<br>
However, just selecting the Container object, the context menu
shows only "New Child-&gt; Products My Base Object". If instead I
select the extended object (Computer), then the same context menu
now shows both actions:
<br>
- New Child-&gt; Products My Base Object
<br>
-          -&gt; Products Computer
<br>
<br>
so the question is: how can I have both actions available from the
beginning (consider for instance to start with an empty
Container)?
<br>
<br>
Thank you very much
<br>
Vincenzo
<br>
</blockquote>
</body>
</html>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: EMF Editor Context menu and hierarchical Ecores [message #781124 is a reply to message #780990] Fri, 20 January 2012 16:02 Go to previous message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 235
Registered: January 2012
Senior Member

Ed,
great! Thanks.
It works like a charm!
Thank you
Vincenzo

Re: EMF Editor Context menu and hierarchical Ecores [message #781177 is a reply to message #780990] Fri, 20 January 2012 11:18 Go to previous message
Vincenzo Caselli is currently offline Vincenzo CaselliFriend
Messages: 235
Registered: January 2012
Senior Member

Ed,
great! Thanks.
It works like a charm!
Thank you
Vincenzo

Il 20/01/2012 07:06, Ed Merks ha scritto:
> Vincenzo,
>
> Have a look at
> <http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html>
>
>
> http://ed-merks.blogspot.com/2008/01/creating-children-you-didnt-know.html
>
Previous Topic:[CDO] Importing a UML model
Next Topic:Delegating content types to the global URIConverter
Goto Forum:
  


Current Time: Fri Mar 29 08:39:22 GMT 2024

Powered by FUDForum. Page generated in 0.02452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top