|How to add custom code templates to my plugin? [message #670307]
||Fri, 13 May 2011 09:26
| Dwight Johnson
Registered: March 2011
I am working on a plugin myplugin that supports a custom webproject and perspective.
XHTML, CSS en .JS have an adapted syntax.
Code templates need to be provided that must be stored in the plugin in templates/templates.xml.
In templates.xml resides:
Some template content...
In plugin.xml we have:
This template does indeed show up in Preferences > Web > HTML files > Editor > Templates under context=HTML Tag.
What I do not understand is: how can I introduce a new HTML context 'CE_HTML' where my new templates will reside under? Changes/additions allowed only in myplugin.
I tried this in plugin.xml:
<!-- Templates -->
with templates in htmldefault-templates2.xml but nothing shows up.
Any suggestion would be much appreciated.
|(no subject) [message #693645 is a reply to message #670343]
||Wed, 06 July 2011 19:45
|| Nitin Dahyabhai
Registered: July 2009
On 5/13/2011 11:20 AM, Dwight Johnson wrote:|
> Nitin Dahyabhai wrote on Fri, 13 May 2011 10:31
>> The HTML Templates preference page is only designed to
>> show the template contexts defined by the HTML plug-ins. It sounds
>> like you need to contribute your own subclass of
> Hello Nitin,
> That seems to be rather a big task.
Not as much as you think. Besides, our template proposal computers
won't be processing the templates from your contexts anyway.
> Under Windows > Show View > there is a template view. For some reason it
> does show templates for java but not for
It's not implemented for those editors since the editors are built in a
way that their viewer configurations and supported content type can be
changed on the fly. The Templates View is locked down in one content
type from the start (possibly before we've figured out which content
type is in the editor), and that's all it ever gets to show.
Eclipse WTP Source Editing and JSDT
Eclipse WTP, IBM
Powered by FUDForum
. Page generated in 0.01498 seconds