| Xtext editor with pages [message #1015841] |
Sun, 03 March 2013 12:15  |
Dana Klein Messages: 54 Registered: October 2012 |
Member |
|
|
Hi,
I want to edit the XtextEditor so it will contain multiple pages.
I tried to create a class that extends MultiPageEditorPart and implements IResourceChangeListener and within it to create XtextEditor as the first page.
but when i run it, there is null pointer exception on setDocumentProvider(documentProvider.get()).
I don't know where it is should be initialized.
so my question is whether i should continue with this path of solution? (if so how to fix my issue) or what is the best solution?
|
|
|
| Re: Xtext editor with pages [message #1016426 is a reply to message #1015841] |
Wed, 06 March 2013 07:10  |
Dana Klein Messages: 54 Registered: October 2012 |
Member |
|
|
I found a solution, hope it will help.
i made eclipse create the class and initiate it properly.
IConfigurationElement[] configs = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.ui.editors");
for(IConfigurationElement currentConfElement : configs) {
if(currentConfElement.getAttribute("id").equals(<TextEditor id>)) {
try {
editor = (XtextEditor) currentConfElement.createExecutableExtension("class");
} catch (CoreException e) {
e.printStackTrace();
}
break;
}
}
[Updated on: Wed, 06 March 2013 07:11] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.01522 seconds