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 "Graphical Modeling Framework/Models/GenModel"

m (error corrected)
(Main properties of GenEditorGenerator described)
Line 1: Line 1:
This page contains a list of '''GMF GenModel''' parameters designed to be changed by user. Generated code could be fine-tuned by adjusting corresponding values. If any of these parameters was modified by user and stored in '''GMF GenModel''', new value should be preserved on next transformation from '''GMF MapModel''' to '''GMF GenModel'''.
+
[[GMF GenModel]] is data model used by [[Graphical Modeling Framework|GMF]] to generate diagramming code. Intention of this model is pretty similar to EMF GenModel. [[GMF GenModel]] could be treated as a set of parameters for JET templates used to generate the code.
 +
 
 +
This page contains a list of [[GMF GenModel]] parameters designed to be changed by user. Generated code could be fine-tuned by adjusting corresponding values. If any of these parameters was modified by user and stored in [[GMF GenModel]], new value should be preserved on next transformation from [[GMF MapModel]] to [[GMF GenModel]].
  
 
== GenEditorGenerator ==
 
== GenEditorGenerator ==
'''Copyright Text''' - multi-line text property. Specified text will be included as a top-level comment into the generated .java and plugin.xml files. Be careful – due to the current java merge settings top-level comments will not be changed for existing files - only newly generated .java files will be adornment with this comment. To change copyright text in existing .java files we suggest to remove all the sources and re-generating code from GMF GenModel.
+
'''Copyright Text''' - multi-line text property. Specified text will be included as a top-level comment into the generated .java and plugin.xml files. Be careful – due to the current java merge settings top-level comments will not be changed for existing files - only newly generated .java files will be adornment with this comment. To change copyright text in existing .java files we suggest to remove all the sources and re-generating code from [[GMF GenModel]].
  
 
'''Diagram File Extension''' - string property holding extension for diagram file.
 
'''Diagram File Extension''' - string property holding extension for diagram file.
Line 10: Line 12:
 
'''Dynamic Templates''' - boolean property switching on user-defined templates processing on generating code from this model (see '''Template Directory''' property).
 
'''Dynamic Templates''' - boolean property switching on user-defined templates processing on generating code from this model (see '''Template Directory''' property).
  
'''Model ID''' – string property identifying generated diagram. Value of this property will be derived form EMF meta-model name by default. This value should be unique among the generated diagramming plug-ins existing in any Eclipse installation. To create several GMF GenModels (diagrams) for the same meta-model this string should be changed to make it unique for each GMF GenModel instance.
+
'''Model ID''' – string property identifying generated diagram. Value of this property will be derived form EMF meta-model name by default. This value should be unique among the generated diagramming plug-ins existing in any Eclipse installation. To create several [[GMF GenModel]]s (diagrams) for the same meta-model this string should be changed to make it unique for each [[GMF GenModel]] instance.
 +
 
 +
'''Package Name Prefix''' – string property representing valid java package. This is a common super-package for all the generated java classes.
 +
 
 +
'''Same File For Diagram And Model''' – boolean property indicating that model elements should be stored in a diagram file, default value == ''false''. [[Graphical Modeling Framework|GMF]] allows to generate code storing model elements in a two ways:
 +
 
 +
1.    Single file keeping diagram visual information together with model structure (value == ''true'')
 +
 
 +
2.    Two different files - first for model contents and second for diagram-specific visual information (value == ''false''). The structure of model file in this situation will corresponds to the file structure created by standard generated EMF editor for this domain model.
  
'''Package Name Prefix'''
+
It is recommended to use separate file for storing diagram information (default value of this option) to utilize most of the [[Graphical Modeling Framework|GMF]] features for example - creating several diagrams for the same domain model.
  
'''Same File For Diagram And Model'''
+
'''Template Directory''' – string property indicating path to the root directory with user-defined code generation templates. This property will be used only if '''Dynamic Templates''' property was set to true. Value of this property could be either valid EMF URI specifying location of the folder with templates or platform-relative path written in a form: ''/project-name/path''.
  
'''Template Diractory'''
+
[[Graphical Modeling Framework|GMF]] is using JET templates for code generation. Original templates are located in a ''template'' directory inside ''org.eclipse.gmf.codegen'' plug-in. To customize generated code user can copy necessary template file(s) from this plug-in into the folder specified as '''Template Directory''' and change template(s) content. Modified template(s) will be used on next code generation.
  
 
== GenDiagram ==
 
== GenDiagram ==

Revision as of 07:19, 30 June 2006

GMF GenModel is data model used by GMF to generate diagramming code. Intention of this model is pretty similar to EMF GenModel. GMF GenModel could be treated as a set of parameters for JET templates used to generate the code.

This page contains a list of GMF GenModel parameters designed to be changed by user. Generated code could be fine-tuned by adjusting corresponding values. If any of these parameters was modified by user and stored in GMF GenModel, new value should be preserved on next transformation from GMF MapModel to GMF GenModel.

GenEditorGenerator

Copyright Text - multi-line text property. Specified text will be included as a top-level comment into the generated .java and plugin.xml files. Be careful – due to the current java merge settings top-level comments will not be changed for existing files - only newly generated .java files will be adornment with this comment. To change copyright text in existing .java files we suggest to remove all the sources and re-generating code from GMF GenModel.

Diagram File Extension - string property holding extension for diagram file.

Domain File Extension - string property holding extension for domain model file.

Dynamic Templates - boolean property switching on user-defined templates processing on generating code from this model (see Template Directory property).

Model ID – string property identifying generated diagram. Value of this property will be derived form EMF meta-model name by default. This value should be unique among the generated diagramming plug-ins existing in any Eclipse installation. To create several GMF GenModels (diagrams) for the same meta-model this string should be changed to make it unique for each GMF GenModel instance.

Package Name Prefix – string property representing valid java package. This is a common super-package for all the generated java classes.

Same File For Diagram And Model – boolean property indicating that model elements should be stored in a diagram file, default value == false. GMF allows to generate code storing model elements in a two ways:

1. Single file keeping diagram visual information together with model structure (value == true)

2. Two different files - first for model contents and second for diagram-specific visual information (value == false). The structure of model file in this situation will corresponds to the file structure created by standard generated EMF editor for this domain model.

It is recommended to use separate file for storing diagram information (default value of this option) to utilize most of the GMF features for example - creating several diagrams for the same domain model.

Template Directory – string property indicating path to the root directory with user-defined code generation templates. This property will be used only if Dynamic Templates property was set to true. Value of this property could be either valid EMF URI specifying location of the folder with templates or platform-relative path written in a form: /project-name/path.

GMF is using JET templates for code generation. Original templates are located in a template directory inside org.eclipse.gmf.codegen plug-in. To customize generated code user can copy necessary template file(s) from this plug-in into the folder specified as Template Directory and change template(s) content. Modified template(s) will be used on next code generation.

GenDiagram

GenPlugin

GenEditorView

Back to the top