[go: up one dir, main page]

Skip to content

eclipse-glsp/glsp-examples

Eclipse GLSP Examples Build Status

This repository contains code examples that demonstrate how to build diagram editors with the Graphical Language Server Platform (GLSP). The examples are focused on the integration of GLSP editors with the cloud-based Eclipse Theia IDE using the GLSP Theia integration and the Java based GLSP Server Framework.

Each example is self-contained and provides both, an example diagram client (glsp-client directory) and its corresponding GLSP server (glsp-server directory).

Prerequisites

The following libraries/frameworks need to be installed on your system:

The examples are heavily interwoven with Eclipse Theia, so please also check the prerequisites of Theia.

The web-based/client part of the examples has been developed using Visual Studio Code and the server/java part has been developed with the Eclipse IDE. However, it's of course also possible to use any other IDE or text editor.

Examples

  • Project Templates: The best starting point for your own diagram editor project. The project templates are available for several combinations of tool platform integrations (Theia, VS Code), source models (JSON, EMF) and servers (Node, Java). Please visit the GLSP documentation for more information.

  • Workflow Example: A consistent example provided by all GLSP components. It implements a simple flow chart diagram editor with different types of nodes and edges. The Workflow Example is the main example used for development and integrates all GLSP features

    diagramanimated.mp4

Building the examples & project templates

To build all examples & project templates simply execute the following in the repository root:

yarn build

In addition, it is also possible to build each example or template individually:

yarn build:workflow
yarn build:java-emf-theia
yarn build:node-json-theia
yarn build:node-json-vscode
yarn build:java-emf-eclipse

Running & Debugging the examples

Each example and project template contains a dedicated README with detailed instructions on how to run und debug them.

Debugging the Jave GLSP Server in Eclipse

All Java example GLSP servers are maven projects which can be imported directly into the Eclipse IDE. In contrast to the Java support in VS Code, Eclipse also offers Ecore tooling which is required to manipulate or extend the graph Ecore models (e.g. workflow-graph.ecore).

We recommend to use the Eclipse Modeling Tools package as it already provides most needed plugins out of the box. Only the M2E plugin has to be installed on top to enable maven support in Eclipse.

Use the file menu to import a glsp-server maven project into the Workspace ( File -> Import... -> Maven -> Existing Maven Projects). The projects also contain a launch configuration (<ExampleName>ServerLauncher.launch) to enable debugging via the Run menu.

Integration with other platforms

The general GLSP Client code is separated from the Theia specific glue code and located in a dedicated package with -glsp prefix (e.g. workflow-glsp). This package can be easily reused when the package should be integrated with any other platform. In addition to the Theia integration, GLSP provides the following glue code frameworks:

For a reference implementation of a example specific glue code package please checkout the project templates.

More information

For more information, please visit the Eclipse GLSP Umbrella repository and the Eclipse GLSP Website. If you have questions, please raise them in the discussions and have a look at our communication and support options.

License