Muki
Muki

Reputation: 3641

Eclipse XML Editor in custom FormEditor

I'm trying to develope an Editor for editing my own XML-Format. However I want to provide a "Source" tab, like some other editors (e.g. JPA Persistence XML editor).

My Editor class looks like this

public class DPUEditor extends FormEditor {

  public static final String ID = "de.lmu.ifi.dbs.knowing.ui.editor.DPUEditor"; //$NON-NLS-1$

  @Override
  protected void addPages() {
    try {
        addPage(new ConfigurationPage(this));
        //addPage(new XMLEditor(..)) <- add the XML Editor
    } catch (PartInitException e) {
        e.printStackTrace();
    }
  }
...
}

I found out that org.eclipse.wst.xml provides the standard XML Editor for Eclipse. The short tutorial here didn't help me :(

I just want the plain IEditor where I can put in my IFileEditorInput.

thx, Muki

Upvotes: 1

Views: 1835

Answers (1)

Konstantin Komissarchik
Konstantin Komissarchik

Reputation: 29139

I recommend that you take a look at Sapphire for a much easier way to build form+xml editors based on WTP XML Editor. With Sapphire, you define a semantic model for your data, specify how that model binds to XML using declarative annotations and then describe how to present the model in a form using declarative syntax. You end up with a better and more maintainable editor quicker since so much of the detail is taken care of by the framework.

Intro to Sapphire

Sapphire Website

Upvotes: 2

Related Questions