Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to feed (memory-only) DOM into XMLTableTreeViewer
How to feed (memory-only) DOM into XMLTableTreeViewer [message #142935] Sun, 09 October 2005 10:00 Go to next message
Eclipse UserFriend
Originally posted by: andreas.hochsteger.gmx.at

Hi,

here's what I'm trying to achieve:
I want to extend the XSD editor with a third page (XMLTableTreeViewer)
containing a (read-only) generated sample XML file based on the XSD. The
tree viewer is then used to get the XPath of the selected nodes via a
popup Menu "Copy Node XPath".

So far I've don the following:
I created the Class XSDXPathEditor which extends XSDEditor and overrides
the createPages() method by adding the XMLTableTreeViewer as third page
and setting the model of the tree viewer with the same model as the
XSDEditor, so I can see the XML nodes of the XSD (working, but just for
testing - should be the model of the generated XML ...). Additionally I
created a org.w3c.dom.Document DOM from the XSD of which I don't know how
to deal with further.

Questions:
How do I feed this generated DOM into the XMLTableTreeViewer without
creating a temorary XML file?
How can I contribute a popup menu entry to the XMLTableTreeViewer? I
already tried with with an editorContribution of the extension point
"org.eclipse.ui.editorActions" and the targetID
" org.eclipse.core.runtime.xml.(table|graph|source|...).Editor Context "
according to
http://www.eclipse.org/webtools/wst/components/sse/overview. html without
success.
Is there a better way to do all this, since I depend on many internal APIs
this way, but I didn't find any working alternatives?
Updating to the latest integration build (wtp-sdk-I20051007.zip) I already
hit the problem, that setModel() isn't available anymore on the
XMLTableTreeViewer. I assume that the latest changes have to do with
http://eclipse.org/webtools/wst/components/sse/designs/Edito rConfiguration.html
but how can I reuse one page of the XML multipage editor and add it to the
XSD multipage editor?

Any hints are highly appreciated!

Thanks,
Andreas
Re: How to feed (memory-only) DOM into XMLTableTreeViewer [message #143468 is a reply to message #142935] Thu, 13 October 2005 15:24 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4435
Registered: July 2009
Senior Member

Andreas Hochsteger wrote:
> here's what I'm trying to achieve:
> I want to extend the XSD editor with a third page (XMLTableTreeViewer)
> containing a (read-only) generated sample XML file based on the XSD. The
> tree viewer is then used to get the XPath of the selected nodes via a
> popup Menu "Copy Node XPath".
>
> So far I've don the following:
> I created the Class XSDXPathEditor which extends XSDEditor and overrides
> the createPages() method by adding the XMLTableTreeViewer as third page
> and setting the model of the tree viewer with the same model as the
> XSDEditor, so I can see the XML nodes of the XSD (working, but just for
> testing - should be the model of the generated XML ...). Additionally I
> created a org.w3c.dom.Document DOM from the XSD of which I don't know
> how to deal with further.
>
> Questions:
> How do I feed this generated DOM into the XMLTableTreeViewer without
> creating a temorary XML file?

Currently you can not use another DOM implementation with the
XMLTableTreeViewer. The SSE XML DOM largely implements the W3C DOM
interfaces and adds some of its own that are required to make it
editable, such as the methods for setting the system and public IDs
on a DocumentType Node (there's a lot more than just extra methods,
honest). These Nodes are also linked to and synchronized with
changes to the the text document.

You may want to open a feature request for showing the table tree
page in the XSD editor.

> How can I contribute a popup menu entry to the XMLTableTreeViewer? I
> already tried with with an editorContribution of the extension point
> "org.eclipse.ui.editorActions" and the targetID
> " org.eclipse.core.runtime.xml.(table|graph|source|...).Editor Context "
> according to
> http://www.eclipse.org/webtools/wst/components/sse/overview. html without
> success.

I think only the source target would work in the XSD editor, and
then only on the Source page. The IDs for the other pages, assuming
the menus are registered for extension, are up to the XSD component.

> Is there a better way to do all this, since I depend on many internal
> APIs this way, but I didn't find any working alternatives?
> Updating to the latest integration build (wtp-sdk-I20051007.zip) I
> already hit the problem, that setModel() isn't available anymore on the
> XMLTableTreeViewer. I assume that the latest changes have to do with
> http://eclipse.org/webtools/wst/components/sse/designs/Edito rConfiguration.html
> but how can I reuse one page of the XML multipage editor and add it to
> the XSD multipage editor?

The XMLTableTreeViewer now takes the IStructuredDocument from the
IDOMModel as its input so that when the input changes on the Source
page it can trigger an input update in the table tree viewer.

--
- Nitin


_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Adding item to JSP popup Menu
Next Topic:Install of XML-Plugin ...
Goto Forum:
  


Current Time: Fri Apr 26 03:20:36 GMT 2024

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

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

Back to the top