Extending Core Model

From Skyway Wiki

Jump to: navigation, search

Contents

Create an ECore model

  1. Create your model using the Ecore Model wizard under Eclipse Modeling Framework
  2. Open your new Ecore Model
  3. Import the Skyway core model
    1. Right click and select Load Resource
    2. Browse the workspace and select org.skyway.core/model/model.ecore
  4. Create your new EClasses, selecting Core as an ESuper Type for each one

Create a generator model

  1. Use the EMF Model wizard under Eclipse Modeling Framework
    1. Select the Ecore model importer
    2. On the Ecore Import screen, select your new Ecore Model
    3. On the Package Selection screen, add org.skyway.core./model/model.genmodel as a referenced generator model. Select it.
    4. Select your package and click Finish
  2. Open your generator model
    1. Click the top level node and under the Model Class Defaults (in the Properties view), change Public Constructors to true.

Generate Model Code

  1. Open your generator
    1. Generate Model Code
    2. Generate Edit Code
    3. Generate Editor Code
  2. Open your model plugin and export the packages for your generated model

Add a Content Type

  1. Open your model plugin
  2. Under Extensions, add an org.eclipse.core.runtime.contentTypes entry
    1. Give your new type a content type id, name and file extension
    2. Enter org.skyway.core.model.core for the base type

Register your model with Skyway

  1. Under Extensions, add an org.skyway.core.modelTypes entry
    1. Give your type an id
    2. Give your type a name
    3. Select the generated interface class for your type
    4. Select the generated impl class for your type
    5. Enter the content type id
    6. Enter the file extension
    7. Enter org.skyway.core.model.registry.PluginTypeDescriptor in the typeDescriptor field.
Personal tools