Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-incubator-dev] Experimental Stylesheet view

I've checked in a new 'Stylesheet' view. Its just experimental at this stage, so don't get raising any bugs just yet!
It displays the stylesheet's model (imports, variables and templats) - and could potentially be the outline viewer for xsl files, but at the moment its just a standalone view that you have to open via 'Show View', in the XML category.
The view makes use of the IWorkbenchAdapter mechanism for displaying the XSL elements. What I needed to do was:
- write an IAdapterFactory (org.eclipse.wst.xsl.ui.internal.XSLModelAdapterFactory)
- register it via the extension point org.eclipse.core.runtime.adapters
Then when displaying the model in a TreeViewer, I just use these two standard classes from org.eclipse.ui.model:
As well as being simple, the big advantage is that any plugin that wishes to display the XSL model in a viewer somewhere can use the standard content and label providers and without knowing anything about the internals of the XSL plugin.tv.setContentProvider(newBaseWorkbenchContentProvider());tv.setLabelProvider(newWorkbenchLabelProvider());
Give it a try.
Cheers,
Doug


Back to the top