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 (Additional properties added)
 
(48 intermediate revisions by 7 users not shown)
Line 1: Line 1:
[[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.
+
#REDIRECT [[Graphical Modeling Framework/Models/GMFGen]]
 
+
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 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.
+
 
+
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.
+
 
+
 
+
'''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''.
+
 
+
[[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.
+
 
+
'''''Note''''': do not mix up template files with .java classes generated by JET while compiling these files. Templates are located in ''org.eclipse.gmf.codegen/templates'' directory and usually has .javajet or .jetinc extensions.
+
 
+
== GenDiagram ==
+
 
+
=== Diagram group ===
+
 
+
'''Contains Shortcuts To''' – multi-value string property specifying a set of domain model file extensions. Generated code will show corresponding files while browsing workspace in dialog available via ''Create Shortcut…'' diagram popup menu action. This dialog allows expanding visible model files to browse model contents, selecting model element and creating shortcut to it on diagram.
+
 
+
It is necessary to specify at least one file extension in this property to get ''Create Shortcut…'' action generated.
+
 
+
It will be possible to create shortcut on a diagram of this type to the model elements from another model during runtime only if:
+
 
+
1. Executed Eclipse instance contains generated [[Graphical Modeling Framework|GMF]] diagramming plug-in feasible to visualize this element as a top-level diagram element.
+
 
+
2. That diagramming plug-in was generated with '''Shortcuts Provided For''' property set to allow shortcuts creation on the diagram of this type (see '''Shortcuts Provided For''').
+
 
+
'''''Example1''''': If two diagrams for two different domain models (''domain1'' and ''domain2'') should be generated and ''domain1'' diagram should allows shortcutting elements from the ''domain2'' models, then '''Contains Shortcuts To''' of the ''domain1'' diagram should contains ''domain2ModelFileExtension'' string.
+
 
+
'''''Example2''''': If diagram should be generated for the ''domain1'' domain model and this diagram should allows shortcutting elements from other ''domain1'' models, then '''Contains Shortcuts To''' property of this diagram should contains ''domain1ModelFileExtension'' string.
+
 
+
 
+
'''Shortcuts Provided For''' – multi-value string property specifying a set of '''Model ID''' properties of ''GenDiagrams''. Generated code will supply shortcuts for model element if:
+
 
+
1. It is an element of this diagram domain model.
+
 
+
2. '''Model ID''' of the diagram asking for a shortcut for this element present in Shortcuts Provided For values (see '''Model ID''').
+
 
+
'''''Example1''''': If two diagrams for two different domain models (''domain1'' and ''domain2'') should be generated and ''domain1'' diagram should allows shortcutting elements from the ''domain2'' models, then '''Shortcuts Provided For''' property of the ''domain2'' diagram should contains ''domain1'' diagram '''Model ID'''.
+
 
+
'''''Example2''''': If diagram should be generated for the ''domain1'' domain model and this diagram should allows shortcutting elements from other ''domain1'' models, then '''Shortcuts Provided For''' property of this diagram should contains its Model ID.
+
 
+
 
+
'''Synchronized'''
+
 
+
 
+
'''Units'''
+
 
+
 
+
'''Validation Decorators'''
+
 
+
 
+
'''Validation Enabled'''
+
 
+
=== Diagram Element group ===
+
 
+
=== Editor group ===
+
 
+
=== Providers group ===
+
 
+
== GenPlugin ==
+
 
+
 
+
== GenEditorView ==
+

Latest revision as of 13:06, 5 October 2011

Back to the top