Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext editor with pages(Xtext editor with pages)
Xtext editor with pages [message #1015841] Sun, 03 March 2013 17:15 Go to next message
Dana Klein is currently offline Dana KleinFriend
Messages: 63
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 12:10 Go to previous message
Dana Klein is currently offline Dana KleinFriend
Messages: 63
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 12:11]

Report message to a moderator

Previous Topic:Automatic Validation
Next Topic:Scoping of references in my DSL
Goto Forum:
  


Current Time: Wed Nov 26 09:11:26 GMT 2014

Powered by FUDForum. Page generated in 0.01808 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software