PCM Development/Sirius Editors

Aus SDQ-Wiki

This page documents specifics for the development of the Sirius PCM editors. Documentation about usage of the Sirius PCM editors, can be found here.

Setting up the Development Environment

If you intend to develop new PCM Sirius editors or to carry the development of existing ones, please install Eclipse Modeling tools along with Sirius, preferably from the update site, and the Palladio plugins, preferably from the nightly update site. It is also preferable not to install the PCM Sirius Editors plugin to avoid eventual conflicts, and rather import them as projects in the workspace, as described below. If you intend to implement new properties sheets for your editor, you also have to install EEF.

As a convention, each PCM editor is composed of at least two plugins, that have to obey the following naming conventions:

  • The project containing the viewpoint files must named org.palladiosimulator.editors.sirius.mySiriusEditor
  • The project containing, among other things, the external java actions used in your viewpoint must be named org.palladiosimulator.editors.sirius.mySiriusEditor.custom
    • The external java actions must be placed in the package org.palladiosimulator.editors.sirius.mySiriusEditor.custom.externaljavaactions


Workspace of host Eclipse

The workspace of host Eclipse must contain all the plugins that your editor needs to function properly:

  • org.palladiosimulator.editors.sirius.mySiriusEditor.custom and preferably all other custom projects org.palladiosimulator.editors.sirius.*.custom
  • org.palladiosimulator.editors.sirius.services: Java Services used by diverse PCM Sirius Editors, that you can also use in your own.
  • org.palladiosimulator.editors.sirius.custom and org.palladiosimulator.editors.sirius.custom.style: Utilities and external java actions used by diverse PCM Sirius Editors, that you can also use in your own. This project must be located in both Eclipse instances for the Java Services to function properly.
  • org.palladiosimulator.editors.sirius.ui: This project contains the ui contributions like the toolbar and the project creation wizards.


Workspace of runtime Eclipse

The workspace of runtime Eclipse should contain the VSPs and eventually the modeling projects in which you test the editor(s).

  • org.palladiosimulator.editors.sirius.mySiriusEditor and preferably all other VSPs
  • org.palladiosimulator.editors.sirius.services: As said earlier, this project must be located in both Eclipse instances for the Java Services to function properly.


Issue Tracker

https://sdqbuild.ipd.kit.edu/jira/secure/IssueNavigator.jspa?reset=true&jqlQuery=project+%3D+EDITORS+AND+component+%3D+Sirius


Update Site and Testing

If you want to test the editors with a fresh install you should not use the aggregated nightly update site which contains all Palladio features, but the update site of the Sirius editors directly. This update site is updated directly after a successful built of the editor features. The aggregated update site on the other hand updates only once at around midnight.

https://sdqweb.ipd.kit.edu/eclipse/palladio/editors/sirius/nightly/

Outdated Content
Please note that this article is (partially) outdated.

Development Guide for Editors

Initial Setup

At first you must create a new Viewpoint Specification Projekt. Therefore you need to click on “New -> other - > Sirius -> Viewpoint Specification Project”

HowToSiriusEditor1.png

HowToSiriusEditor2.png



Give it a name, for example "myExample.project.design".

HowToSiriusEditor3.png

After pushing "Finish" it creates you a new Projekt with all dependencies and extensions. Within the folder "description" you'll find your Viewpoint Specification Model (<name>.odesign).

HowToSiriusEditor4.png

By clicking on "Sirius Specification" with the right mouse button you can create a new Viewpoint, like described in the 4 Min Sirius Tutorial

Try out the Editor

To check, if the created editor works, it's nessecary to start another Eclipse application in the current application.
The "Program arguments" should be: -os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog
and the "VM arguments":
-Dosgi.requiredJavaVersion=1.6
-Xms256m
-Xmx768m

Create a "New Palladio Project" in the second Eclipse instance with "New->Other->New Palladio Project->Next".

ApplySiriusProject2.png

Give it a name and push again "Next" (not Finish!!!).

ApplySiriusProject3.png

Then you have the option to choose one of four example templates. Select one and push "Finish".
To apply the design, the project has to be turned into a "Modeling Project". Click with the right mouse button on the project and convert it.

ApplySiriusProject5.png

Click again with the right mouse button on the project folder an select the earlier created viewpoint "Example View".

ApplySiriusProject6.png

ApplySiriusProject7.png



Look back in your first eclipse instace: depending on the selected Domain Class (in the example *.system) the representation will only be opened with *.system elements.

ApplySiriusProject8.png



Find a proper element and create via right mouse click a new diagram.

ApplySiriusProject9.png


Queries for Labels

To put a number and some text on a label, all parameters have to be the same type. If you want to write: "Number of participants: 30" it's possible to write on the Label Expression : ['Number of participants: ' + number.toString()/]

Using Containers for Elements with Multiple Attributes

Acceleo services

Acceleo services

External Java actions

external Java actions

Using Border Items

Border Items in Sirius can only be configured in a limited way in the VSM. Additional configuration is possible by extending Sirius. Using the customized style it is possible to provide a BorderItemLocator that allows to control the position of the Border Items relative to their parents. Additionally it is possible to provide custom EditParts if the styles provided by Sirius are not flexible enough.

Metamodel Extensions

To support non-invasive extensions of the Palladio Metamodel the MDSD-Profiles have been developed. To support the metamodel extension in the sirius editor it is best to create a viewpoint extension. In this extension the profile-metamodel has to be registered. Now it is possible to create new diagram elements, for example for StereotypeApplications. Because the metamodel-extension cannot be accessed from the original model, it is necessary to write Java services. These services can then access the concrete extension`s API in order to change the model. Model editing can be implemented in the same way or by using external Java actions.

Stereotype Support

The Stereotype support for the ComposedProvidingRequiringEntity-Editor is implemented using two commands for (un)applying Profiles and Stereotypes. StereotypeApplications are represented graphically as nodes. The API-methods for retrieving the StereotypeApplications are exposed by an service class to Acceleo.

Architectural Template Support

The Composed Providing Requiring Entity Editor supports representation and modification of [Templates].

The representation is realized using normal Sirius mappings of the corresponding classes (AT, Role) that are accessible by a Acceleo service.

Editing of Architectural Templates does the application and removal of Architectural Templates and their Roles as well as editing their parameters. AT/Role application is implemented with commands that are shown in the editor palette. These commands create selection dialogs for the elements and then delegate to the Architectural Template API. Editing the parameters is realized with a double-click tool.

Limitations

Sirius currently imposes some limitations on the editors:

  • Missing styles or configuration possibilities of styles. For example there are currently only limited container border styles or there is no style for bordered nodes that rotates an image based on the parent`s side the node is attached to. In order to extend these one has to resort to either writing a patch for Sirius that includes the desired behavior or write a custom EditPart.

See also

Keywords: Palladio, Sirius, Editor