Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Dawn Codegen"

(Generate the GMF plugins)
(Preparations)
 
(17 intermediate revisions by the same user not shown)
Line 41: Line 41:
 
**************************************************-->
 
**************************************************-->
  
==Generate the EMFfragment with Dawn==
+
==Generate the EMF extension with Dawn==
  
 
===Generate the EMF plugins===
 
===Generate the EMF plugins===
  
Now we will generate the code as you would do it for a normal project. This means the model code, the edit plug-in and GMF diagram plug-in.
+
Now generate the EMF edit and the EMF editor plugin for your domain model.
  
 +
[[Image:Dawn codegen generate edit code.PNG]]
  
[[Image:GenerateModelCode.png]]
+
[[Image:Dawn codegen generate editor code.PNG]]
  
 +
===Generate the Dawn Genmodel===
  
===Dawn Genmodel===
+
To generate the Dawn Genmodel you now need to right-click the *.genmodel and select "Generated Dawn Genmodel"
  
Now your workspace contains the plug-ins: the one containing the model code, the edit plug-in and the diagram plug-in. Now right click the the gmf gen model an examine the context menu. You will see an additional entry called "Generate Dawn Genmodel"
+
[[Image:Dawn codegen generate dawn Genmodel emf.PNG]]
  
[[Image:Dawncodegen1.png]]
+
This will create two files. One named *.dawngenmodel and one named *.dawngenmodel_emf. The previous is a global file which contains information that can influence all extended frameworks. The latter only contain specific data for the EMF extension.
  
Running this will create a new file called acore.dawngenmodel. This model contains specific information for the Dawn generator.
+
[[Image:Dawn codegen generate dawn Genmodel emf result.PNG]]
  
[[Image:Dawngenmodel.png]]
 
  
 +
By double-clicking the *.dawngenmodel a multipage editor will be opened which shows all condfigurations.
  
For example it allows to configure the names of the extension classes generated by dawn.
+
[[Image:Dawn codegen generate dawn Genmodel editor.PNG]]
  
[[Image:Dawngenmodel2.png]]
+
===Generate the EMF extension===
  
 +
To generate the extension for EMF right-click the *.dawngenmodel_emf and choose "Generate Dawn EMF Fragment"
  
 +
[[Image:Dawn codegen generate extension.PNG]]
 +
 +
==Generate GMF extension with Dawn==
 +
 +
===Preparations===
 +
 +
First let us install GMF's Notational Model and the Runtime.
 +
 +
[[Image:GMF Runtime Notation.PNG]]
 +
 +
AS GMF Tooling is not on the Relase train we need to install is seperately from the following update site: http://download.eclipse.org/modeling/gmp/updates/milestones
 +
 +
GMF Toling has a dependency to QVT which needs to be installed first from here :  http://download.eclipse.org/modeling/m2m/qvtoml/updates/releases
 +
 +
[[Image:GMF Tooling.PNG]]
 +
 +
[[Image:Dawn codegen QVT.PNG]]
 +
 +
 +
The code generation part for GMF also had to leave the release train an thus it needs to be installed from the latest stable CDO release
 +
 +
https://hudson.eclipse.org/hudson/job/emf-cdo-integration/lastStableBuild/artifact
 +
 +
 +
[[Image:Dawn codegen CodeGen GMF.PNG]]
  
===Generate GMF extension with Dawn===
 
 
===Generate the GMF plugins===
 
===Generate the GMF plugins===
  
Line 75: Line 102:
 
[[Image:GenerateDiagramCode.png]]
 
[[Image:GenerateDiagramCode.png]]
  
===Generate the fragment===
+
===Generate the Dawn Genmodel===
 +
 
 +
Now your workspace contains the plug-ins: the one containing the model code, the edit plug-in and the diagram plug-in. Now right click the the gmf gen model an examine the context menu. You will see an additional entry called "Generate Dawn Genmodel"
 +
 
 +
[[Image:Dawncodegen1.png]]
 +
 
 +
 
 +
Righ-clicking on hte newly created *dawngenmodel_gmf file will generated the extension.
 +
 
 +
[[Image:Dawn codegen generate GMF extension.PNG]]
 +
 
 +
===Generate the extension===
  
 
In a final step now right click the Dawn genmodel and choose "Generate Dawn GMF Fragment" from the context menu.  
 
In a final step now right click the Dawn genmodel and choose "Generate Dawn GMF Fragment" from the context menu.  
Line 84: Line 122:
  
 
[[Image:Dawnfinish.png]]
 
[[Image:Dawnfinish.png]]
 
 
===Generate the GMF extension with Dawn===
 

Latest revision as of 08:35, 2 December 2011

Dawn CodeGen Tutorial

Before you start make sure that you have the following components installed:

  • EMF
  • CDO
  • Dawn
  • GMF

Preparation

We will examine the Dawn Codegen by using the Acore example from the Dawn SDK. In the beginning we need to get all necessary model files. Open the Plug-ins View (Window-->Show View-->Others) as shown in the picture below.

Dawn openpluginsView.png

Now select the plug-in org.eclipse.emf.cdo.dawn.examples.acore and import it as soure plug-in

Dawn PluginsView2.png


Generate the EMF extension with Dawn

Generate the EMF plugins

Now generate the EMF edit and the EMF editor plugin for your domain model.

Dawn codegen generate edit code.PNG

Dawn codegen generate editor code.PNG

Generate the Dawn Genmodel

To generate the Dawn Genmodel you now need to right-click the *.genmodel and select "Generated Dawn Genmodel"

Dawn codegen generate dawn Genmodel emf.PNG

This will create two files. One named *.dawngenmodel and one named *.dawngenmodel_emf. The previous is a global file which contains information that can influence all extended frameworks. The latter only contain specific data for the EMF extension.

Dawn codegen generate dawn Genmodel emf result.PNG


By double-clicking the *.dawngenmodel a multipage editor will be opened which shows all condfigurations.

Dawn codegen generate dawn Genmodel editor.PNG

Generate the EMF extension

To generate the extension for EMF right-click the *.dawngenmodel_emf and choose "Generate Dawn EMF Fragment"

Dawn codegen generate extension.PNG

Generate GMF extension with Dawn

Preparations

First let us install GMF's Notational Model and the Runtime.

GMF Runtime Notation.PNG

AS GMF Tooling is not on the Relase train we need to install is seperately from the following update site: http://download.eclipse.org/modeling/gmp/updates/milestones

GMF Toling has a dependency to QVT which needs to be installed first from here : http://download.eclipse.org/modeling/m2m/qvtoml/updates/releases

GMF Tooling.PNG

Dawn codegen QVT.PNG


The code generation part for GMF also had to leave the release train an thus it needs to be installed from the latest stable CDO release

https://hudson.eclipse.org/hudson/job/emf-cdo-integration/lastStableBuild/artifact


Dawn codegen CodeGen GMF.PNG

Generate the GMF plugins

Let's generate the GMF diagram plug-in.

GenerateDiagramCode.png

Generate the Dawn Genmodel

Now your workspace contains the plug-ins: the one containing the model code, the edit plug-in and the diagram plug-in. Now right click the the gmf gen model an examine the context menu. You will see an additional entry called "Generate Dawn Genmodel"

Dawncodegen1.png


Righ-clicking on hte newly created *dawngenmodel_gmf file will generated the extension.

Dawn codegen generate GMF extension.PNG

Generate the extension

In a final step now right click the Dawn genmodel and choose "Generate Dawn GMF Fragment" from the context menu.

Dawncodegen2.png

Now a fragment will be created containing all the specific extensions for your diagram.

Dawnfinish.png

Back to the top