Search code examples
javaandroideclipseeclipse-kepler

How to use custom SurroundWith feature of eclipse


In eclipse SurroundWith offers default options like try/catch, while, switch etc. I want to add another option to that list how to do that?

In SurroundWith pop up there is one option at bottom Configure Template where we can configure template it also shows list of predefine template but my question is how to use one of those template and place it on pop up menu.......


Solution

  • It seems to be any Template which uses the ${line_selection} variable is included in the list.

    So a very simple template would be:

    {
      ${line_selection}
    }
    

    which would add { } around the selection.