Last active
September 27, 2015 15:46
-
-
Save serge1/02e9714f5a7654d54c5a to your computer and use it in GitHub Desktop.
Xtext Dsl Editor in Multi-Page Editor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To add you Xtext Dsl Editor to Multi-Page Editor | |
Getting the instance of XText editor | |
MyDslActivator activator = MyDslActivator.getInstance(); | |
final Injector injector = activator.getInjector("org.shashwat.xtext.mydsl.MyDsl"); | |
XtextEditor xtextEditor = injector.getInstance(XtextEditor.class); | |
Remember to have editor input instance of IFileEditorInput. XtextEditor uses XtextDocumentProvider which extends FileDocumentProvider | |
FileEditorInput fileEditorInput = new FileEditorInput(file); // Here file is instance of IFile | |
int index = addPage(xtextEditor, fileEditorInput); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment