[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Re: Label/Content Provider for XML Editor's content outline?

Muneer wrote:
I am looking for the code for the label and content providers for the xml editor's content outline.

I found the JFaceNodeLabelProvider and JFaceNodeContentprovider, found in org.eclipse.wst.xml.ui.internal.contentoutline, but they don't seem to be parsing out Attribute Nodes from the DOM model when I try to use those classes with MY editor.

However, the content outline view in WTP's xml editor does show attribute nodes, and they seem to be displaying correctly.
My treeviewer, uses the JFaceNodeLabelProvider and JFaceNodeContentprovider, however it doesn't recognize attribute nodes from the DOM model.

The outline's not showing attribute nodes in the tree, it is instead including specific attribute names and values in the *label* for elements. You're not missing any functionality by the sounds of it, but if you want Attr Nodes to be their own tree items, you'll have to extend or reuse the content provider in your own outline configuration class (subclassing the XMLContentOutlineConfiguration). Then you can assign that outline configuration class to be used with your editor part ID or content type ID as the target:


	<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
		<contentOutlineConfiguration
			class="MuneerContentOutlineConfiguration"
			target="muneer" />
	</extension>

--
Nitin Dahyabhai
Structured Source Editing