Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » e4 and xtend editors(i want to include generated xtend editors into an e4 Application)
e4 and xtend editors [message #1014827] Tue, 26 February 2013 09:49
Helge Müller is currently offline 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 12:53]

Report message to a moderator

Previous Topic:OSGI DS vs DI via Contexts
Next Topic:Eclipse editor tooltip
Goto Forum:
  


Current Time: Wed Aug 27 19:13:59 EDT 2014

Powered by FUDForum. Page generated in 0.07065 seconds