|
Re: XML templates filtering by extension [message #499502 is a reply to message #498689] |
Mon, 23 November 2009 03:47 |
|
Csaba Koncz wrote:
> Our product uses WST XML Editor for editing two types of XML files
> (i.e. there are two XML Schemas these documents conform with). I have
> also created a number of XML templates that provide meaningful attribute
> values and XML snippets for these XMLs.
> However, the templates are relevant only in one type of XML and not in
> the other. As the templates are contributed by different plugins, I am
> wondering whether it is possible to enable/disable the templates
> depending on the file being edited, so that only the meaningful XML
> templates are offered to the user?
Yes, but not in the manner you're probably thinking of. If the two
files are separated into to different Content Types
(org.eclipse.core.contenttype.contentTypes extension point) and the
templates into different contexts, the editor will be able to use
two different source viewer configurations for them
( http://www.eclipse.org/webtools/wst/components/sse/designs/E ditorConfiguration.html).
The content assist processors that are used by default can then
choose which template contexts from which to load your templates.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
|
|
Re: XML templates filtering by extension [message #502230 is a reply to message #501031] |
Mon, 07 December 2009 10:35 |
Csaba Koncz Messages: 49 Registered: July 2009 |
Member |
|
|
Hello Dave,
Thank you for your advice. I checked the plugins you mentioned, but I am still rather confused. First of all, I could not find the extension for plugging content assistors (I have installed xml_ui feature 3.1.0 and xsl.feature 1.0.2 from the Galileo update site).
Then, I saw how templates can be separated using separate template storages. But the different templates still use distinct contexts, e.g. the XSL templates can be defined only for context "xsl_new". What I would expect is the ability to define XSL templates for all XML contexts, so that, for example, the standard copy template would be available also for "xml_tag" (so I can insert the copy template into an existing XSL file).
Further, when defining a ContributionTemplateStore a key is defined for storing the templates. But when contributing templates via the ui.editor.templates extension point there is no way to specify such a key, so the templates will show up in all TemplateStores whose configuration include the template context.
Csaba
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03491 seconds