Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: eab070fe5c23265f2b344bd6f6f4a7b583f09ed6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0" encoding="UTF-8"?>
<cheatsheet title="GMF Tutorial">
  <intro href="http://wiki.eclipse.org/index.php/GMF_Tutorial">
    <description>This tutorial guides you through the definition, mapping, and generation of a graphical editor for mindmaps using GMF.<br/><br/>To start working on this cheatsheet, click the &quot;Click to Begin&quot; button below.<br/><br/>For each step, press the Help button (?) to access full instructions and viewlets for each step.</description>
  </intro>
  
  <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#A_New_Project"
        dialog="true"
        title="Create a New Project" skip="true">
  	<action pluginId="org.eclipse.gmf.doc.ui"
			class="org.eclipse.gmf.internal.doc.ui.actions.OpenProjectWizardAction"
			param1="org.eclipse.gmf.examples.mindmap"
			param2="model"/>		
     <description>First, we'll create a new project to hold our models.<br/><br/>The default name will be set and a new 'model' folder will be created for you, if you use the "Click to Perform" button below.</description>
  </item>
  
  <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Domain_Model_Definition" skip="true"
        title="The Domain Model">
  	<description>At this point, you can either copy the provided mindmap.ecore model into the 'model' folder, or use the ECore editor to model it using the provided diagram (press help (?) icon above).<br/><br/>When you're done, create a new genmodel for mindmap.ecore and generate the model and edit code.
  		<br/><br/>The following steps are required:
  		<br/><br/>1. Right-click the mindmap.ecore file and select <b>New... | Other... | Eclipse Modeling Framework | EMF Model</b> and use the defaults of the wizard to create a new mindmap.genmodel.
  		<br/><br/>2. Select the Mindmap package below the root of the genmodel and in the Properties view, change the <b>Base Package</b> property to <b>org.eclipse.gmf.examples</b>.
  		<br/><br/>3. Right-click on the root of the genmodel and select <b>Generate Model Code</b> followed by <b>Generate Edit Code</b>.
  		<br/><br/><br/>Now, with our domain model ready, we can begin our graphical definition.  Press "Click to Complete" below.
  	</description>
  </item>
    
  <item
		href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Graphical_Definition" 
		dialog="true" skip="true"
		title="Creating a Graphical Definition">
		<action
			pluginId="org.eclipse.gmf.doc.ui"
			class="org.eclipse.gmf.internal.doc.ui.actions.OpenGraphWizardAction"
			param1="mindmap.gmfgraph"/>
		<description>In a graphical definition, you will define figures, nodes, compartments, connections, etc.<br/><br/>Using the wizard, we can get started on our graphical definition by examining our domain model.  Use the "Click to Perform" button to get started.
		<br/><br/>The following steps are required:
  		<br/><br/>1. In the wizard, select the 'org.eclipse.gmf.examples.mindmap/model' as the parent folder for your mindmap.gmfgraph model.
  		<br/><br/>2. The second page of the wizard has a <b>Browse</b> button that should easily find our mindmap.ecore model.
  		<br/><br/>3. The last page of the wizard gives us options for those features found in our domain model (node, link, or label).  For now, uncheck all but the Topic element as a node and its name attribute as a label.
		</description>
	</item>
  
  <item href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Tooling_Definition"
        dialog="true" skip="true"
  		title="Create a Tooling Definition">
  	<action
		pluginId="org.eclipse.gmf.doc.ui"
		class="org.eclipse.gmf.internal.doc.ui.actions.OpenToolWizardAction"
		param1="mindmap.gmftool"/>
  	<description>Our graphical definition for our editor will need tooling to be useful. We will again use a wizard to get started by examining the domain model once more.
  		<br/><br/>The following steps are required:
  		<br/><br/>1. Again, select the 'model' folder to hold the mindmap.gmftool model.
  		<br/><br/>2. And, on the second page we will locate our mindmap.ecore file as before.
  		<br/><br/>3. On the last page, we will uncheck all but our Topic node for now.
  	</description>
  </item>
  
  <item title="Create a Mapping Definition" dialog="true" skip="true"
  		href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Mapping_Definition">
  	<action
		pluginId="org.eclipse.gmf.doc.ui"
		class="org.eclipse.gmf.internal.doc.ui.actions.OpenMapWizardAction"
		param1="mindmap.gmfmap"
		param2="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.ecore"
		param3="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmfgraph"
		param4="platform:/resource/org.eclipse.gmf.examples.mindmap/model/mindmap.gmftool"
		/>
     <description>Now it's time to map our graphical elements and their tools to our domain model.
     	<br/><br/>The following steps are required:
  		<br/><br/>1. Again, select the 'model' folder to hold the mindmap.gmfmap model.
  		<br/><br/>2. On the second page, each of our domain, graphical definition, and tooling definition files are preset, so we will just need to press <b>Load</b> for each and press <b>Next</b>.
  		<br/><br/>3. Select <b>Map</b> for our 'Diagram Root Element'.
  		<br/><br/>4. On the last page of the wizard, examine the mappings determined appropriate by the wizard. For now, remove all but our Topic node and press <b>Finish</b>.
     </description>
  </item>
  
  <item title="Code Generation" skip="true" href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Code_Generation">
     <description>The last model you'll need will be transformed from the mapping model and contain those properties needed to generate the source code for your editor.<br/><br/>To produce the generator model, right-click on your mindmap.gmfmap file and select <b>Create generator model...</b>.<br/><br/>You may want to browse this model and examine its properties. There are many options to consider when generating code. When you're ready, right-click the mindmap.gmfgen file and select <b>Generate diagram code</b>.</description>
  </item>
  
  <item title="Running the Diagram" href="http://wiki.eclipse.org/index.php/GMF_Tutorial#Running_the_Diagram">
     <description>You are ready to test the diagram. From the <b>Run | Run...</b> menu, create a new <b>Eclipse Application</b> runtime configuration and launch your diagram using the default settings.<br/><br/>You'll need to create a project and then a <b>New | Examples | Mindmap diagram</b>. Explore the functionality provided, including layout, alignment, selection, etc.</description> 
  </item>
</cheatsheet>

Back to the top