Question

I am currently stuck on what I feel like should be an easy solution, but I am not really getting anywhere with this. I am new to Eclipse RCP. I am trying to implement a view in which, all it does, is display a string, which has been formatted to XML. As in, my application does what it is meant to do, and when the user clicks Save, it saves all the info as an xml. I can get this xml as one long, unformatted string. I want a pane where the user can see (only see, not edit) the XML code that is going to be saved.

The reason I want a view is because this view is a multi-instance view, dependent on the perspective it is in. And I want it to display in XML format, with syntax highlighting. It would be nice for it to look like in an editor with line numbers and such, but with good formatting I am satisfied.

Does anyone know the best (any) way to implement this? Even some 3rd party widget is perfect for me.

Thanks!!

Was it helpful?

Solution

IIRC, the Plug-In editor example does basic syntax coloring and you can use the javax.transform packages to go from a stream to a DOM and back to a (formatted) stream.

OTHER TIPS

just make your editor inherit from StructuredTextEditor (org.eclipse.wst.sse.ui.StructuredTextEditor.StructuredTextEditor)

For further details here:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top