All Projects → ObeoNetwork → Xtext-Sirius-integration

ObeoNetwork / Xtext-Sirius-integration

Licence: other
this repository provide examples to embed Xtext in Sirius diagram editors.

Programming Languages

java
68154 projects - #9 most used programming language
GAP
223 projects
Xtend
68 projects

Xtext Sirius Embedded Editor Example

This plug-in contains a basic framework easing the embedding of an Xtext editor inside a diagram representation created with Sirius.
This is not needed at all to load Xtext models and create diagrams on top of those, this functionnaliy is provided by the Sirius project itself in its update-site.

Features

Screenshot of diagram without embedded text editor

Screenshot of diagram with embedded text editor

Requires

  • Eclipse Sirius 1.x
  • Xtext 2.x

How to

  • Create a tool in your modeler, and in the model operation, add an External Java Action Call and set OpenEmbeddedEditor as id.
  • Extends OpenXtextEmbeddedEditor to bind your Xtext model.
import org.eclipse.xtext.example.domainmodel.ui.internal.DomainmodelActivator;
import com.google.inject.Injector;
import org.obeonetwork.dsl.viewpoint.xtext.support.action.OpenXtextEmbeddedEditor;

public class OpenEmbeddedEditor extends OpenXtextEmbeddedEditor {
	@Override
	protected Injector getInjector() {
		return  DomainmodelActivator.getInstance().getInjector("org.eclipse.xtext.example.domainmodel.Domainmodel");
	}
}
  • register your java action
   <extension point="org.eclipse.sirius.externalJavaAction">
      <javaActions
            actionClass="com.yourcompany.OpenEmbeddedEditor"
            id="OpenEmbeddedEditor">
      </javaActions>
   </extension>

Known limitation

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].