How do I update an Eclipse template variable at runtime? [message #591082] |
Mon, 02 February 2009 23:28 |
Debajit Adhikary Messages: 8 Registered: July 2009 |
Junior Member |
|
|
I've added the following new Eclipse template via extension point. It
simply adds a template for a sample testTag tag.
<code>
<!-- Add code template -->
<extension point="org.eclipse.ui.editors.templates">
<template autoinsert="true"
contextTypeId="html_tag"
description="TestTag Description"
id="org.eclipse.jst.jsf.ui.newHtmltag"
name="testTag">
<pattern>
<![CDATA[
<testTag style="background: ${color}"></testTag>
]]>
</pattern>
</template>
<resolver
contextTypeId="html_tag"
type="src"
lass="TestTagTemplateVariableResolver">
</resolver>
</extension>
</code>
What I'd cannot figure out is how to change the value of the $(color)
variable at runtime. More specifically, when the user presses Ctrl+Space
(or the equivalent for content-assist) and types in "testTag" and presses
Enter -- instead of the "color" placeholder text, I'd like it replaced by
some other text value I have in another class. How do I do this?
|
|
|
Powered by
FUDForum. Page generated in 0.04553 seconds