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.
Difference between revisions of "Dawn Codegen"
(→Generate the EMF model code) |
(→Generate the GMF fragment with Dawn) |
||
Line 1: | Line 1: | ||
− | = | + | ==Dawn CodeGen Tutorial== |
− | Before you start make sure that you have the following components | + | Before you start make sure that you have the following components installed: |
*EMF | *EMF | ||
*CDO | *CDO | ||
Line 7: | Line 7: | ||
*GMF | *GMF | ||
− | ==Preparation== | + | ==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. | 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. | ||
Line 41: | Line 41: | ||
**************************************************--> | **************************************************--> | ||
− | ==Generate the EMF | + | ==Generate the EMFfragment with Dawn== |
+ | |||
+ | ===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 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. | ||
− | + | ||
[[Image:GenerateModelCode.png]] | [[Image:GenerateModelCode.png]] | ||
− | + | ===Dawn Genmodel=== | |
− | + | ||
− | + | ||
− | + | ||
− | ==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" | 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" | ||
Line 68: | Line 66: | ||
[[Image:Dawngenmodel2.png]] | [[Image:Dawngenmodel2.png]] | ||
− | ==Generate the fragment== | + | |
+ | |||
+ | ===Generate the GMF plugins=== | ||
+ | |||
+ | Let's generate the GMF diagram plug-in. | ||
+ | |||
+ | [[Image:GenerateDiagramCode.png]] | ||
+ | |||
+ | ===Generate the fragment=== | ||
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 77: | Line 83: | ||
[[Image:Dawnfinish.png]] | [[Image:Dawnfinish.png]] | ||
+ | |||
+ | |||
+ | ===Generate the GMF extension with Dawn=== |
Revision as of 06:48, 5 June 2011
Contents
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.
Now select the plug-in org.eclipse.emf.cdo.dawn.examples.acore and import it as soure plug-in
Generate the EMFfragment with Dawn
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.
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"
Running this will create a new file called acore.dawngenmodel. This model contains specific information for the Dawn generator.
For example it allows to configure the names of the extension classes generated by dawn.
Generate the GMF plugins
Let's generate the GMF diagram plug-in.
Generate the fragment
In a final step now right click the Dawn genmodel and choose "Generate Dawn GMF Fragment" from the context menu.
Now a fragment will be created containing all the specific extensions for your diagram.