e4 and xtend editors [message #1014827] |
Tue, 26 February 2013 14:49 |
Helge Müller Messages: 1 Registered: February 2013 |
Junior Member |
|
|
Hello everyone,
i'm currently writing my bachelors thesis and i want to create an e4 Application.
For that i'm getting editors generated with xtend/xtext.
Since i have no control over this code i'm kind of lost.
When i try to instanciate an editor i get a "Workbench has not been created yet." error
This is how i try to open it:
@PostConstruct
public void createControls(Composite parent) {
IPath filepath = new Path("/home/hmu/test.regexp");
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(filepath);
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IEditorDescriptor editorDescriptor = IDE.getDefaultEditor(file);
if (editorDescriptor == null || editorDescriptor.isOpenExternal()) {
// if no editor to open the diagram is present ignore it
return;
}
try {
IDE.openEditor(page, file, editorDescriptor.getId(), true);
} catch (PartInitException e) {
// opening the diagram failed but as it is optional it can be safely
// ignored
}
}
I have included the plugins for the "compatibility layer". And i could not find how to do this properly. Anyone have any pointers for me?
Thanks in advance, Helge
edit: if any info is missing please tell and i'll try my best to provide it.
[Updated on: Sun, 03 March 2013 17:53] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03842 seconds