tags:

views:

27

answers:

2

I'm writing a custom XML editor for our project and want to add support for templates. I.e when the user writes "<ab:mytag" and presses ctrl + space they get the option of inserting a chunk of text with a default/dummy parameters.

But this should be available only in the XML editor. How would I go about this?

Clarification: The templates I'm talking about are the ones available when you write for example "syso" in your java editor and press ctrl + space. In preferences you can add your own templates. What I want to do is do define my own templates, for my own XML tags, but I want to do this in the code and have it only effect my editor

A: 

Go to the preferences then XML -> XML Files -> Editor -> Templates. Define your new template there.

nanda
Thanks, but I wanted to add templates through code, not manually.
Fredrik
A: 

After alot of searching I fount this ppt that answered almost all questions I had:

http://www.eclipsecon.org/2008/sub/attachments/Extending_the_XML_and_SSE_editors_from_the_WTP_Project_.ppt

The templates I was after can programatically be added with the use of the extension point org.eclipse.ui.editors.templates

Fredrik