Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Editor code templates(How to setup custom templates for CSS/JS/XHTML editors?)
Editor code templates [message #671651] Wed, 18 May 2011 15:08
Dwight Johnson is currently offline Dwight JohnsonFriend
Messages: 19
Registered: March 2011
Junior Member
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:

          name="My templates"

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

Previous Topic:Error when setting up JAX-WS project
Next Topic:Web Service + EMF + Teneo
Goto Forum:

Current Time: Mon Jan 25 09:03:13 GMT 2021

Powered by FUDForum. Page generated in 0.02134 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top