carbidecpp20devenv/plugins/org.eclipse.emf.cheatsheets_2.4.0.v200808251517/cheatsheets/GenerateExtendedEMF.xml
author cawthron
Wed, 18 Mar 2009 17:21:00 -0500
changeset 1 82d1d1de1a01
permissions -rw-r--r--
import Carbide.c++
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8" ?>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     2
<cheatsheet title="Generating an Extended EMF Model">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     3
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     4
  <intro href="/org.eclipse.emf.doc/tutorials/slibmod/slibmod.html">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     5
    <description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     6
      This cheat sheet is a step-by-step description of how to generate an extended EMF
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     7
      model and editor from a Rose class diagram.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     8
      <br /><br />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
     9
      This cheat sheet continues on from either the &quot;Generating an EMF Model from Rose&quot;
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    10
      or &quot;Generating an EMF Model from Annotated Java&quot; cheat sheet. Ensure that you have
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    11
      completed at least one of them before contining.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    12
    </description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    13
  </intro>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    14
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    15
  <item title="Set up the environment">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    16
    <description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    17
  	  Your environment must be set up before you can perform the steps in this cheat sheet.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    18
    </description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    19
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    20
    <subitem
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    21
      label="Create an &quot;EMF Cheatsheet Data&quot; project in your workspace with the example &quot;schoollibrary.mdl&quot; file."
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    22
      skip="true" >
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    23
      <action
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    24
        pluginId="org.eclipse.emf.cheatsheets"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    25
        class="org.eclipse.emf.cheatsheets.actions.CopyFileFromPluginAction"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    26
        param1="EMF Cheatsheet Data"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    27
        param2=""
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    28
        param3="org.eclipse.emf.cheatsheets/archive/extended/schoollibrary.mdl" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    29
        translate="" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    30
    </subitem>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    31
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    32
    <subitem
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    33
      when="true" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    34
      label="Ensure that either &quot;library.rose&quot;, &quot;library.rose.edit&quot;, and &quot;library.rose.editor&quot; or &quot;library.java&quot;, &quot;library.java.edit&quot;, and &quot;library.java.editor&quot; exist in your workspace. Otherwise, you will need to complete either the &quot;Generating an EMF Model from Rose&quot; or the &quot;Generating an EMF Model from Annotated Java&quot; cheat sheet before continuing."
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    35
      skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    36
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    37
    <subitem
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    38
      when="true" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    39
      label="Delete or rename the following projects if they exist in your workspace: &quot;schoollibrary.rose&quot;,&quot;schoollibrary.rose.edit&quot;,&quot;schoollibrary.rose.editor&quot;"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    40
      skip="true" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    41
  </item>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    42
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    43
  <item
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    44
    title="Import the model from Rose"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    45
    href="/org.eclipse.emf.doc/tutorials/slibmod/slibmod.html#step1a"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    46
    dialog="true"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    47
    skip="true">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    48
    <description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    49
      First, you must create a new &quot;schoollibrary.rose&quot; EMF project in your workspace, importing
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    50
      the Rose model to create the EMF model.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    51
    </description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    52
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    53
    <subitem label="Select &quot;File &gt; New &gt; Project...&quot;. Expand &quot;Eclipse Modeling Framework&quot; and select &quot;EMF Project&quot;. Then, click &quot;Next&quot;." skip="true">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    54
      	<action
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    55
          pluginId="org.eclipse.emf.cheatsheets"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    56
          class="org.eclipse.emf.cheatsheets.actions.OpenEMFProjectWizardAction"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    57
          param1="schoollibrary.rose"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    58
          param2="org.eclipse.emf.importer.rose" 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    59
          translate="" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    60
    </subitem>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    61
    <subitem label="Enter &quot;schoollibrary.rose&quot; as the project name, then click &quot;Next&quot;." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    62
    <subitem label="Select &quot;Rose class model&quot;, then click &quot;Next&quot;." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    63
    <subitem label="Click &quot;Browse Workspace...&quot;, and expand &quot;EMF Cheatsheet Data&quot; to select &quot;schoollibrary.mdl&quot;. Then click &quot;Next&quot;." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    64
    <subitem label="In the &quot;Root packages&quot; table, select the package &quot;org.eclipse.example.schoollibrary&quot;, which will be generated." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    65
    <subitem label="Click &quot;Browse...&quot; to locate the file containing the library model that will be extended." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    66
    <subitem label="Expand either the &quot;library.rose&quot; or library.java&quot; project to select the &quot;model/library.genmodel&quot; file within it. Click &quot;OK&quot;." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    67
    <subitem label="Under &quot;Referenced generator models&quot;, select the &quot;org.eclipse.example.library&quot; package, and click &quot;Finish&quot;." skip="false" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    68
  </item>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    69
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    70
  <item
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    71
    title="Generate the code"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    72
    href="/org.eclipse.emf.doc/tutorials/slibmod/slibmod.html#step2"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    73
    dialog="true"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    74
    skip="true">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    75
    <description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    76
      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.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    77
    </description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    78
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    79
    <subitem label="In the generator, right click on &quot;Schoollibrary&quot; and select &quot;Generate All&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    80
    <subitem label="If automatic building has been disabled, select &quot;Project &gt; Build All&quot; to compile the generated code." skip="true">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    81
      <action
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    82
        pluginId="org.eclipse.emf.cheatsheets"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    83
        class="org.eclipse.emf.cheatsheets.actions.BuildAllProjectsAction" />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    84
    </subitem>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    85
  </item>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    86
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    87
  <item
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    88
    title="Run the generated editor"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    89
    href="/org.eclipse.emf.doc/tutorials/slibmod/slibmod.html#step3"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    90
    dialog="true"
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    91
    skip="true">
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    92
    <description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    93
      Now, you are set to run the generated editor and create a new school library instance.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    94
    </description>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    95
    <onCompletion>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    96
      Congratulations! You have succesfully extended an EMF model, generated the code, and created an instance of the extended model.
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    97
    </onCompletion> 
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    98
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
    99
    <subitem label="Select the &quot;schoollibrary.rose&quot; project in the package explorer and invoke the &quot;Run &gt; Run As &gt; Eclipse Application&quot; menu item. This starts a runtime instance of Eclipse with the newly generated plug-ins available." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   100
    <subitem label="In the runtime instance, create a new general project called &quot;schoollibrarytest&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   101
    <subitem label="Right click &quot;schooollibrarytest&quot; and select &quot;New &gt; Other...&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   102
    <subitem label="Expand &quot;Example EMF Model Creation Wizards&quot; and select &quot;Schoollibrary Model&quot;. Then, click &quot;Next&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   103
    <subitem label="Enter &quot;My.schoollibrary&quot; as the file name, then click &quot;Next&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   104
    <subitem label="Select &quot;School Library&quot;; as the model object, then click &quot;Finish&quot;." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   105
    <subitem label="The generated school library editor is opened. Expand &quot;platform:/resource/schoollibrarytest/My.schoollibrary&quot;. Right click &quot;School Library&quot; and select &quot;New Child &gt; School Book&quot; to create a school book object in the library." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   106
    <subitem label="Create additional books and writers in the library, and edit the objects' properties in the properties view." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   107
    <subitem label="Select &quot;File > Save&quot; to save the instance." />
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   108
  </item>
82d1d1de1a01 import Carbide.c++
cawthron
parents:
diff changeset
   109
</cheatsheet>