Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNewbie question: not all classes of the ecore available in the editor
https://www.eclipse.org/forums/index.php/mv/msg/489123/1064001/#msg_1064001
I am new to EMF and trying to learn by means of a tutorial (the forum prevents me from posting the link it's a tutorial from the University of Kiel, part of the "Eclipse Practical (winter term 2012/13)").
My ecore model corresponds to a turing machine modelled as a finite state machine. So basically I have the classes "TuringMachine" and the classes "State" and "Transition". Each TuringMachine has at least one State and 0-n transitions.
I generated the genmodel and from it the .edit and .editor code. According to my tutorial I am now supposed to use the editor to create an instance of a the turingmachine.ecore model.
Using the "Example EMF Model Creation Wizard " --> "Turingmachine Model" I created a new instance named myTM.turingmachine and chose a turingmachine-Object to be the root of the instance. Now as I try to create new States and Transitions, the context menue provides only "State" as possible new child of the turingmachine root object (see attached screenshot). But how can I create new Transitions?
I tried to add another class to my ecore model, to see if it will be displayed in the context menu. And same problem occurs: the new class is not available in the context menu, the only possible child of the root object is "State".
Thanks, Sabina]]>Sabina EH2013-06-17T08:40:51-00:00Re: Newbie question: not all classes of the ecore available in the editor
https://www.eclipse.org/forums/index.php/mv/msg/489123/1064077/#msg_1064077
Does a TuringMachine as a containment reference of type Transition?
Perhaps it's a State that has that type of containment reference. By
default the generated editors will only have creation commands for each
object's containment reference.
On 17/06/2013 2:17 PM, Sabina EH wrote:
> Hi,
>
> I am new to EMF and trying to learn by means of a tutorial (the forum prevents me from posting the link :( it's a tutorial from the University of Kiel, part of the "Eclipse Practical (winter term 2012/13)").
> My ecore model corresponds to a turing machine modelled as a finite state machine. So basically I have the classes "TuringMachine" and the classes "State" and "Transition". Each TuringMachine has at least one State and 0-n transitions.
> I generated the genmodel and from it the .edit and .editor code. According to my tutorial I am now supposed to use the editor to create an instance of a the turingmachine.ecore model.
> Using the "Example EMF Model Creation Wizard " --> "Turingmachine Model" I created a new instance named myTM.turingmachine and chose a turingmachine-Object to be the root of the instance. Now as I try to create new States and Transitions, the context menue provides only "State" as possible new child of the turingmachine root object (see attached screenshot). But how can I create new Transitions?
>
> I tried to add another class to my ecore model, to see if it will be displayed in the context menu. And same problem occurs: the new class is not available in the context menu, the only possible child of the root object is "State".
> Thanks, Sabina]]>Ed Merks2013-06-17T13:51:35-00:00Re: Newbie question: not all classes of the ecore available in the editor
https://www.eclipse.org/forums/index.php/mv/msg/489123/1064190/#msg_1064190
It seems to have been some Eclipse problem (bug?). What now worked for me is the following: I made a backup of my .ecore file. Then I deleted the whole project in Eclipse and created it again from scratch. I added the (unchanged) .ecore file, generated the .genmodel and from it the the code. Now it works!
Anyways, thanks a lot.
Sabina]]>Sabina EH2013-06-18T07:36:11-00:00Re: Newbie question: not all classes of the ecore available in the editor
https://www.eclipse.org/forums/index.php/mv/msg/489123/1064194/#msg_1064194
Comments below.
On 18/06/2013 9:36 AM, Sabina EH wrote:
> Thank you, Ed. The reference from TuringMachine to Transition is no containment reference. But form State there is a containment reference called "outgoingTransitions" to Transition.
So I'd expect the create action for a transition to be on the context
menu for a State.
> It seems to have been some Eclipse problem (bug?). What now worked for me is the following: I made a backup of my .ecore file. Then I deleted the whole project in Eclipse and created it again from scratch. I added the (unchanged) .ecore file, generated the .genmodel and from it the the code. Now it works!
Probably it works the same as before. In this image you show the State
being selected, in the other, you showed the TuringMachine being
selected. Each has a different context menu with different create actions.
>
> Anyways, thanks a lot.
> Sabina]]>Ed Merks2013-06-18T08:00:46-00:00