| 1 |
<?xml version="1.0" encoding="UTF-8" ?> |
| 2 |
<cheatsheet title="Generating an EMF Model from Rose"> |
| 3 |
|
| 4 |
<intro href="/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html"> |
| 5 |
<description> |
| 6 |
This cheat sheet is a step-by-step description of how to generate an EMF |
| 7 |
model and editor from a Rose class diagram. |
| 8 |
</description> |
| 9 |
</intro> |
| 10 |
|
| 11 |
<item title="Set up the environment"> |
| 12 |
<description> |
| 13 |
Your environment must be set up before you can perform the steps in this cheat sheet. |
| 14 |
</description> |
| 15 |
|
| 16 |
<subitem |
| 17 |
label="Create an "EMF Cheatsheet Data" project in your workspace with the example "library.mdl" file." |
| 18 |
skip="true"> |
| 19 |
<action |
| 20 |
pluginId="org.eclipse.emf.cheatsheets" |
| 21 |
class="org.eclipse.emf.cheatsheets.actions.CopyFileFromPluginAction" |
| 22 |
param1="EMF Cheatsheet Data" |
| 23 |
param2="" |
| 24 |
param3="org.eclipse.emf.cheatsheets/archive/rose/library.mdl" |
| 25 |
translate="" /> |
| 26 |
</subitem> |
| 27 |
|
| 28 |
<subitem |
| 29 |
when="true" |
| 30 |
label="Delete or rename the following projects if they exist in your workspace: "library.rose", "library.rose.edit", "library.rose.editor"." |
| 31 |
skip="true" /> |
| 32 |
</item> |
| 33 |
|
| 34 |
<item |
| 35 |
title="Import the model from Rose" |
| 36 |
href="/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html#step1a" |
| 37 |
dialog="true" |
| 38 |
skip="true"> |
| 39 |
<description> |
| 40 |
First, you must create a new "library.rose" EMF project in your workspace, importing |
| 41 |
the Rose model to create the EMF model. |
| 42 |
</description> |
| 43 |
|
| 44 |
<subitem label="Select "File > New > Project...". Expand "Eclipse Modeling Framework" and select "EMF Project". Then, click "Next"." skip="true"> |
| 45 |
<action |
| 46 |
pluginId="org.eclipse.emf.cheatsheets" |
| 47 |
class="org.eclipse.emf.cheatsheets.actions.OpenEMFProjectWizardAction" |
| 48 |
param1="library.rose" |
| 49 |
param2="org.eclipse.emf.importer.rose" |
| 50 |
translate="" /> |
| 51 |
</subitem> |
| 52 |
<subitem label="Enter "library.rose" as the project name, then click "Next"." skip="false" /> |
| 53 |
<subitem label="Select "Rose class model", then click "Next"." skip="false" /> |
| 54 |
<subitem label="Click "Browse Workspace...", and expand "EMF Cheatsheet Data" to select "library.mdl". Then click "Next"." skip="false" /> |
| 55 |
<subitem label="Select the package "org.eclipse.example.library", then click "Finish"." skip="false" /> |
| 56 |
</item> |
| 57 |
|
| 58 |
<item |
| 59 |
title="Generate the code" |
| 60 |
href="/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html#step2" |
| 61 |
dialog="true" |
| 62 |
skip="true"> |
| 63 |
<description> |
| 64 |
Generate the code to implement the model and an editor for it. The generator is automatically opened on completion of the wizard in the previous step. |
| 65 |
</description> |
| 66 |
|
| 67 |
<repeated-subitem values="Model,Edit,Editor"> |
| 68 |
<subitem label="In the generator, right click on "Library" and select "Generate ${this} Code"." /> |
| 69 |
</repeated-subitem> |
| 70 |
<subitem label="If automatic building has been disabled, select "Project > Build All" to compile the generated code." skip="true"> |
| 71 |
<action |
| 72 |
pluginId="org.eclipse.emf.cheatsheets" |
| 73 |
class="org.eclipse.emf.cheatsheets.actions.BuildAllProjectsAction" /> |
| 74 |
</subitem> |
| 75 |
</item> |
| 76 |
|
| 77 |
<item |
| 78 |
title="Run the generated editor" |
| 79 |
href="/org.eclipse.emf.doc/tutorials/clibmod/clibmod.html#step4" |
| 80 |
dialog="true" |
| 81 |
skip="true"> |
| 82 |
<description> |
| 83 |
Now, you are set to run the generated editor and create a new library instance. |
| 84 |
</description> |
| 85 |
<onCompletion> |
| 86 |
Congratulations! You have succesfully created an EMF model from a Rose class diagram, generated the code, and created an instance of the model. |
| 87 |
</onCompletion> |
| 88 |
|
| 89 |
<subitem label="Select the "library.rose" project in the package explorer and invoke the "Run > Run As > Eclipse Application" menu item. This starts a runtime instance of Eclipse with the newly generated plug-ins available." /> |
| 90 |
<subitem label="In the runtime instance, create a new general project called "librarytest"." /> |
| 91 |
<subitem label="Right click "librarytest" and select "New > Other..."." /> |
| 92 |
<subitem label="Expand "Example EMF Model Creation Wizards" and select "Library Model". Then, click "Next"." /> |
| 93 |
<subitem label="Enter "My.library" as the file name, then click "Next"." /> |
| 94 |
<subitem label="Select "Library"; as the model object, then click "Finish"." /> |
| 95 |
<subitem label="The generated library editor is opened. Expand "platform:/resource/librarytest/My.library". Right click "Library" and select "New Child > Writer" to create a writer object in the library." /> |
| 96 |
<subitem label="Create additional writers and books in the library, and edit the objects' properties in the properties view." /> |
| 97 |
<subitem label="Select "File > Save" to save the instance." /> |
| 98 |
</item> |
| 99 |
</cheatsheet> |