Blogbody Rotating Header Image

IDEA Live Templates: more powerful than you think

I am always amazed by how much you can do with the IDEA live templates feature. For those that don’t make their own live templates and share them with your team, you should.

Today I created a nice live template (bound to xa) that lets me easily define new WebWork actions when in xwork.xml:

idea-live-template.gif

The variables are defined as:

  • CLASS: descendantClassesEnum(”com.opensymphony.xwork.Action”, “true”)
  • EXT: enum(”jsp”, “ftl”, “vm”), with the default being jsp

Now I can define a new action by typing xa and I am presented with a list of all WebWork actions in my project. You can download the live template to try out yourself here: webwork.xml

8 Comments on “IDEA Live Templates: more powerful than you think”

  1. #1 Jason Carreira
    on Feb 1st, 2006 at 1:37 pm

    I create my own, but how do I add this one to my project?

  2. #2 Jason Carreira
    on Feb 1st, 2006 at 1:38 pm

    posting again to subscribe…

  3. #3 Sudar
    on Feb 1st, 2006 at 9:01 pm

    I have been using IDEA for about a year now, but I never created my own live templates. Thanks for the heads up. Now I can type less. :)

  4. #4 Alexey Epishkin
    on Feb 2nd, 2006 at 1:07 am

    You can look at built in templates for examples of using those descendantClassesEnum, etc.

  5. #5 Marc Logemann
    on Feb 2nd, 2006 at 1:17 am

    I am only using the default live template so far but it seems its worth to have a look at them in more detail. I could imagine some nice Spring aware live templates…

  6. #6 Marc Logemann
    on Feb 2nd, 2006 at 1:37 am

    Weird. descendantClassesEnum() is not explained in the list of possible expression on: http://www.jetbrains.com/idea/docs/help/editing/livetemplates/definetemplates.html

  7. #7 Wim Deblauwe
    on Feb 3rd, 2006 at 12:25 am
  8. #8 Confluence: Research and Development
    on Feb 6th, 2006 at 7:39 pm

    IDEA Rocks

    All of you Eclipse zealots check this out: IDEA Live Templates

Leave a Comment