java - IntelliJ shortcut refactor object to list of objects -


lets have method signature:

public string get(){}; 

is there shortcut in intellij highlight string , surround list<> can following:

public list<string> get(){}; 

you can make own surround live template:

  1. go settings/preferences > ide settings > live templates > surround.
  2. add new template.
  3. fill in form
    1. the abbreviation used select surround with context menu.
    2. the description appear in surround with context menu.
    3. the $selection$ variable predefined as, guessed it, selected text.
    4. you can add own variables, such $coll$ make template more generic.
    5. set applicable in... of java (or can more exact if want).

how fill out live template dialog

to use it:

  1. select text.
  2. press ctrl+alt+t on windows or ⌥⌘t on mac
    • the surround with context menu appear new template.
  3. press c (since that's first letter of template's abbreviation) select template.

surround context menu



Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -