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

1
  • Your question is really vague. Could you be more specific ? Commented Oct 7, 2010 at 13:51

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

-2

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

1 Comment

Thanks, but I wanted to add templates through code, not manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.