Live template "magic"

Is it possible to write live templates that do magic with the file in
question, thats NOT at the cursor location?

i.e. add something to the template like
#import org.foo.Bar
doSomethingThatNeedsBar( Bar $foo$ )
{
...
}

Mark


2 comments
Comment actions Permalink

Just use the qualified name of "org.foo.Bar" in the live template. There is
a checkbox "Shorten FQ names" in the live template configuration. It causes
replacing of such names with short with adding necessary import statement.
The checkbox is on by default.

--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"

"Mark Derricutt" <mark@talios.com> wrote in message
news:pan.2002.12.17.03.45.23.196455@talios.com...

Is it possible to write live templates that do magic with the file in
question, thats NOT at the cursor location?

>

i.e. add something to the template like
#import org.foo.Bar
doSomethingThatNeedsBar( Bar $foo$ )
{
...
}

>

Mark

>


0
Comment actions Permalink

"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:atsjh6$pv2$1@is.intellij.net...

Just use the qualified name of "org.foo.Bar" in the live template. There

is

a checkbox "Shorten FQ names" in the live template configuration. It

causes

replacing of such names with short with adding necessary import statement.
The checkbox is on by default.


Ha! I've been wondering for a long time what "FQ" means; it means
"fully-qualified". Kind of ironic that it's abbreviated, eh? (Kind of like
abbreviation being such a long word...)



0

Please sign in to leave a comment.