Re: Eclipse: Template Variable Creation
From: A.Buschmann (a.buschmann_at_vinex.de)
Date: 02/21/04
- Next message: Ira Baxter: "Re: Tool to find unused functions/classes"
- Previous message: Tobias Schierge: "Re: Ant API - Examples where? Please help."
- In reply to: P.Hill: "Eclipse: Template Variable Creation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 21 Feb 2004 18:23:35 +0100
Hello Paul,
"P.Hill" <goodhill@xmission.com> wrote:
<snip>
>those things that have ${...} that result in dynamic substitution when
>Java code is generated
<snip>
I don't think that this could be possible, because some of the predefined
Variables have some
action behind them, like searching for an array, so I think they are defined
somewhere in the Source Code.
> "You can insert your own template variables, which then evaluate to the
name of
> the variable itself.
<snip>
I think you didn't get that right.
They wrote: "evaluate to the name of the variable itself" and that's exactly
what is meant.
1. Try defining a template in "preferences->java->editor->templates" with
name "TempTest"
2. write somewhere in this Template: ${MyTestVariable}
3. open a Java-Editor
4. Type in: "TempTest" and press Ctrl-Space.
In the Source-Code now ${MyTestVariable} is replaces with "MyTestVariable".
That's neither nice nor smothe, but it's exactly
what the help is saying.
Now you are asking: Why then define an Template Variable?
Because when the same Variable appears more than once and you overwrite the
Variable right after pressing Ctrl-Space,
all occurences are replaced at the same time.
For more infos, look into the Eclipse-Help:
Getting Started->Basic tutorial->Editing Java Elements->Using source code
templates
Alex
- Next message: Ira Baxter: "Re: Tool to find unused functions/classes"
- Previous message: Tobias Schierge: "Re: Ant API - Examples where? Please help."
- In reply to: P.Hill: "Eclipse: Template Variable Creation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|