|Editor code templates [message #671651]
||Wed, 18 May 2011 15:08
| Dwight Johnson
Registered: March 2011
Currently I am working on a plugin for Eclipse/Helios that is supposed to offer a development environment (adapted project, nature, perspective, views, code completion and templates) for static webcontent (xhtml, js and css) with reduced/modified syntax as compared to standard static web projects. |
This is what I want to achieve: offer custom css/js/xhtml templates, visibly in TemplatesView, with my templates stored in my plugin. The Templates view should default be part of my custom perspective and adapt it's contents to the type of the active editor.
Here is the corresponding plugin extension:
This extension points does indeed offer under window > Show Views > General > My Templates.
Now back to the template behavior of a standard static web project... the only time that the TemplatesView does indeed show content is for the java editor. In case of css/js/xhtml editors the template view displays the message 'No templates available', although under Windows / Preferences it can be seen that there are default templates defined. I do not understand this.
There are some vague pointers to be found on the web, like this, stating that I should provide for an adapter:
I tried to find out what is happening via the debugger.
I was able to get the debugger into TemplatesView.doCreatePage...
...seeing that for java ITemplatesPage was indeed not null, in contrast to the other editors, but I could not get deeper into the code.
So, what do I need to do to have a populated templates view for css/js and xhtml editors? Are you aware of any example code? There is a javaeditorexample, but this relates to templates defined/displayed in the preferences.
Thanks in advance.
[Updated on: Wed, 18 May 2011 15:09]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02833 seconds