This plug-in provides support to integrate an Xtext editor inside a diagram representation created with Sirius.
- Eclipse Sirius 1.x
- Xtext 2.x
- 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>