Skip to content

Eclipse integration for the Model Modeling Language

Notifications You must be signed in to change notification settings

eMoflon/model-modeling-language-editor

Repository files navigation

Model Modeling Language Editor

The Model modeling language (MML) is a domain-specific modeling language implemented with the open-source language engineering tool Langium. This repository contains all resources to include the MML in Eclipse. Through this we provide an editor for MML files, as well as the export of metamodels and instances to Ecore and XMI files.

For this purpose, an MML Language Server is started when the MML Editor is opened for the first time. Afterwards the editor is displayed as a web page in a webview in a JavaFX window. However, this also makes it clear that a large number of components have to be built and interact.


ℹ️ The MML Editor was tested on Windows 11 under Eclipse 2023-09 with Java 17.

⚠️ Due to incompatibilities of JavaFx with GTK, the MML editor currently cannot be used under Linux!



How to build

  1. Build the web editor first. For simplicity, we provide a Maven build script. For this, the following command can be executed:
    mvn process-resources
    (If Maven is not available, the web editor must be built separately first. Follow the instructions for this. Afterwards the generated files have to be copied from model-modeling-language-browser/public to model-modeling-language-eclipse/MML-Editor/ls)
  2. Open the workspace model-modeling-language-eclipse in Eclipse and import the projects JavaFXDependencies and MML-Editor.
  3. Install required Eclipse plugins:
    • WildWebDeveloper (Link)
    • Google Gson (Link)
  4. Install JavaFx and check that the path to the JavaFx bin directory is added to the Path environment variable. Alternatively, the resources provided in model-modeling-language-eclipse/bin can be used. (Windows only, check HERE for other operating systems)
  5. Right click on the MML Editor project and select Run As -> Eclipse Application. This will start a new Eclipse instance containing the MML editor. At startup it will ask for a new workspace. If the provided resources are used instead of an installation of JavaFx, the path environment variable must also be adjusted for this. Alternatively, this can be done temporarily. For this go to Run As -> Run Configurations..., select the Eclipse Application Configuration, open the Arguments tab and set the following VM argument:
    -Djava.library.path="${workspace_loc}\bin;${env_var:PATH}"
    

Usage

First create a .mml file. When you right-click on it, there is a new entry in the context menu. Click on Open in MML Editor. The first opening may take a few seconds (a loading screen is displayed), because the language server is started in the background first.

We provide several functions via the menu. If the same (or another) file in the same workspace has been modified externally, either all, only the current or all other models can be reloaded. Likewise, changes made in the editor can be saved in the file system.

Finally, MML files can be compiled and converted to EMF files. To do this, select the Export Model function. This will transfer all packages to Ecore files and all instances to XMI files. The exported files are located in the model directory of the project.

Examples

The workspace model-modeling-language-examples serves as a collection of examples. Among others, this includes an implementation of the HospitalExample, which has already been used as an example for eMoflon::IBeX.