[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: Questions about building on top of the XML Editor

Konstantin Komissarchik wrote:
I am in the process of writing a form-based editor for an XML file and I want to use WTP's XML editor as the source view. I found a way to get at the XML DOM of the editor and I am able to push changes from the form-based editor to the source view.

Couple of questions...

1. How does one listen for changes to the DOM (in order to update the form-based UI)?

You might want to check out the XSD and WSDL editor code to see how they do it, as well as the code from the XMLMultiPage Editor. I believe you have to tell the StructuredDocument who is listening for it's events.



2. Is there a trick/utility for handling formatting when creating content? I know how to do it manually by adding various whitespace sections to the DOM tree, but I'd rather not re-invent the wheel if the wheel already exists. :)

Konstantin: if you just want a pretty formatted document, you could programmatically have it execut the SSE formatter to format the document.


Again the best examples are probably the existing XML, XSD, and WSDL editors.