This project provides a diagram editor for Compartment Role Object Models (CROM), built using the Eclipse GLSP framework. It includes:
- 🖥️ A Java-based GLSP server for handling diagram-specific logic
- 🗂️ An EMF-based source model
- 🌐 A Theia integration to make your editor available as Theia application
- 🖼️ A VS Code extension for integrating the diagram editor into Visual Studio Code
The Compartment Role Object Model (CROM) is a conceptual modeling approach that enables dynamic assignment of roles to objects within specific contexts, called compartments. It supports flexible and context-dependent behavior by allowing objects to play different roles in different compartments, enhancing modularity and adaptability in software design. Building on these concepts, the Crom-GLSP leverages CROM principles to provide graphical modeling capabilities for compartment-role-based systems.
The project is organized as follows:
server/: Java-based GLSP server implementation with EMF model handlingclient/: TypeScript/JavaScript client applications and extensionsbrowser-app/: Theia browser applicationcrom-theia/: Theia extension for CROM diagram editorcrom-vscode/: VS Code extensionpackages/: Shared packages and componentsworkspace/: Example workspace with CROM files
- Server:
server/src/main/java/../CromDiagramModule.java - Client Base:
client/packages/crom-sprotty/src/crom-diagram-module.ts - Theia Browser App:
client/browser-app/package.json - VS Code Extension:
client/crom-vscode/extension/src/crom-extension.ts
Ensure the following are installed on your system:
This project is compatible with Theia >=1.39.0 and VS Code >=1.74.0.
The project consists of two main components that need to be built separately: the Java server and the TypeScript/JavaScript client applications.
Use the provided build scripts to build both server and client:
Windows
.\build.ps1Linux/macOS
./build.shYou can also build individual components:
.\build.ps1 server # Windows./build.sh server # Linux/macOScd server
mvn clean verify.\build.ps1 client # Windows./build.sh client # Linux/macOScd client
yarncd client && yarn build:theia # Build Theia applicationcd client && yarn build:vscode # Build VS Code extensionTo clean build artifacts, run:
.\build.ps1 clean # Windows./build.sh clean # Linux/macOScd server && mvn clean # Clean Java server artifactscd client && yarn clean # Clean client artifactsThe project includes IntelliJ IDEA configuration files in the .idea/ directory with pre-configured run configurations:
- Launch CROM GLSP Server: Starts the Java GLSP server on port 5007. Use this configuration for debugging server-side code.
- Theia (Launch CROM - Embedded GLSP Server): Launches Theia with embedded server. This configuration launches the Theia backend application and starts the GLSP server as an embedded process. Note that debugging the GLSP server source code is not possible in this mode.
- Theia (Launch CROM - External GLSP Server): Launches Theia connecting to external server. This configuration expects the GLSP server to be started externally using the Launch CROM GLSP Server configuration.
Use the launch configurations defined in .vscode/launch.json. Open the project in Visual Studio Code and navigate to the Run and Debug view (Ctrl + Shift + D). Choose one of the following launch configurations:
-
Launch CROM GLSP Server: Starts the standalone Java GLSP server. Use this configuration for debugging server-side code. Note: There is also a run configuration available for JetBrains-IDEs.
-
Theia Configurations:
- Backend with embedded GLSP server: This configuration launches the Theia backend application and starts the GLSP server as an embedded process. Breakpoints in the source files of the
crom-theia/src/nodedirectories will be picked up. Note: Debugging the GLSP server source code is not possible in this mode. - Backend with external GLSP server: This configuration launches the Theia backend application without embedding the GLSP server. Breakpoints in the source files of the
crom-theia/src/nodedirectories will be picked up. Note: This configuration expects the GLSP server to be started externally using the Launch CROM GLSP Server configuration. - Frontend Chrome launcher: Launches a Google Chrome instance and opens the Theia frontend at
http://localhost:3000. The example workspace will automatically open, containing a.cromfile. Double-click the file in the Explorer to open it with the CROM Diagram Editor. Breakpoints in the source files of thecrom-theia/src/browserdirectories will be picked up.
- Backend with embedded GLSP server: This configuration launches the Theia backend application and starts the GLSP server as an embedded process. Breakpoints in the source files of the
-
VS Code Extension Configurations:
- Extension with embedded server: Starts a second VS Code instance with the extension installed. Opens an example workspace containing a
.cromfile. The GLSP server runs as an embedded process. Note: Server-side debugging is not available in this mode. - Extension with external server: Similar to the above, but expects the GLSP server to be started externally using the Launch CROM GLSP Server configuration. This allows debugging both the client and server code.
- Extension with embedded server: Starts a second VS Code instance with the extension installed. Opens an example workspace containing a
-
Compound Configurations for launching multiple components simultaneously:
- Theia: Launch CROM Theia Frontend & Backend with embedded GLSP Server: Launches both the Theia backend (with the embedded GLSP server) and the Theia frontend.
- VS Code: Launch CROM extension with external GLSP Server: Launches both the CROM GLSP Server and the VS Code extension in external server mode. This enables simultaneous debugging of both the client and server code.
To package the VS Code extension as a .vsix file, run:
cd client
yarn packageThe resulting .vsix file will be located in the client-vscode/extension/dist directory and can be installed in VS Code.
More Documentation is available in separate location. This includes detailed information on architecture, design decisions, and usage examples
