Menu

CreatingANewEMFProject

Tom Swain

Creating a New EMF Project


This tutorial describes how to create an EMF project, generate code from an EMF model using annontated Java, and run an EMF-generated model editor.

[TOC]

Project Setup


Create Empty EMF Project

Create package under src/

Create or copy-in source


Initial EMF Setup


New->Other

Select EMF Generator Model

Set parent folder and file name (*.genmodel)

Select Annotated Java Code

Select package(s)

Finish


Code Generation


.genmodel edits

  • Add copyright
  • Put Edit, Edtior, and Tests Code in model plugin
  • Table Providers = true
    Double-click *.genmodel file

    Right-click the package root and select Generate All.

    Fix any javac errors


Running the Application


Right-click project

Run As ... Eclipse Application

In new Eclipse Window

  • New->Project
  • Select General/Project : Next
  • Enter project name : Finish
  • Right-click new project
  • New->Other
  • Select model type under Example EMF Model Creation Wizards : Next
  • Select model and enter file name : Next
  • Select EMFModel as root : Finish


Incorporating Revisions


Right-click *.genmodel and select Reload

Select "Annotated Java" : Next

Select Root package : Finish

Perform steps under Code Generation



Related

Wiki: Home

MongoDB Logo MongoDB