Speedup coding with eclipse editor templates

In eclipse IDE go to…

  1. Windows > Preferences
  2. Java > Editor > Templates
  3. Create a new template OR select the Existing one to edit
  4. Add this pattern in there
logger.info("${enclosing_method}().${word_selection} : " + ${word_selection}${});${cursor}

References :

  • http://poojapainter11.wordpress.com/2013/08/10/eclipse-shortcuts/
  • http://www.grobmeier.de/log4j-2-performance-close-to-insane-20072013.html
  • http://eannaburke.wordpress.com/2013/06/28/a-rudimentary-logger/

#eclipse, #ide, #utility

Find/Replace in eclipse using regex

We can find a regex pattern and do a replace as mentioned below. This is very helpful when we are doing bulk replacing.
eg : Comment all the lines containing a word (selectedWord)

Steps :

  1. Ctrl + F
  2. Find ^.selectedWord.$
  3. Replace //$0
  4. Options : Check Regular Expressions

#eclipse, #ide, #utility