Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Xtext editor with pages(Xtext editor with pages)
Xtext editor with pages [message #1015841] Sun, 03 March 2013 12:15 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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] by Moderator

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


Current Time: Sat Jul 05 09:28:18 EDT 2025

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

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

Back to the top