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

Graphical Modeling Framework/Models/GenModel

< Graphical Modeling Framework
Revision as of 12:43, 30 June 2006 by Alexander.shatalin.borland.com (Talk | contribs) (Additional properties added)

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.

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 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

Back to the top