Extending Core Model
From Skyway Wiki
Contents |
Create an ECore model
- Create your model using the Ecore Model wizard under Eclipse Modeling Framework
- Open your new Ecore Model
- Import the Skyway core model
- Right click and select Load Resource
- Browse the workspace and select org.skyway.core/model/model.ecore
- Create your new EClasses, selecting Core as an ESuper Type for each one
Create a generator model
- Use the EMF Model wizard under Eclipse Modeling Framework
- Select the Ecore model importer
- On the Ecore Import screen, select your new Ecore Model
- On the Package Selection screen, add org.skyway.core./model/model.genmodel as a referenced generator model. Select it.
- Select your package and click Finish
- Open your generator model
- Click the top level node and under the Model Class Defaults (in the Properties view), change Public Constructors to true.
Generate Model Code
- Open your generator
- Generate Model Code
- Generate Edit Code
- Generate Editor Code
- Open your model plugin and export the packages for your generated model
Add a Content Type
- Open your model plugin
- Under Extensions, add an org.eclipse.core.runtime.contentTypes entry
- Give your new type a content type id, name and file extension
- Enter org.skyway.core.model.core for the base type
Register your model with Skyway
- Under Extensions, add an org.skyway.core.modelTypes entry
- Give your type an id
- Give your type a name
- Select the generated interface class for your type
- Select the generated impl class for your type
- Enter the content type id
- Enter the file extension
- Enter org.skyway.core.model.registry.PluginTypeDescriptor in the typeDescriptor field.

