Total Pageviews

2009/11/17

Eclipse Tips and Shortcuts

http://shawnkercher.com/2009/11/15/eclipse-tips-and-shortcuts/

Shortcuts

Most Common

Delete linectrl + d
Go to Methodctrl + o

Format Codectrl + shift + f
Last Editctrl + q
Line Numberctrl + l
Move line(s)alt + up/down
Open Resourcectrl + shift + r

Open Proj Propalt + enter
Open Typectrl + shift + t
Run Java Appalt + shift + x, j
Run JUnitalt + shift + x, t
Shortcut Listctrl + shift + l

Refactoring Tips

Extract Methodalt + shift + m
Extract Variablealt + shift + l
Renamealt + shift + r
Surroundalt + shift + z

Templates

Go to Windows->Preferences->Java->Editor->Templates

To Activate templates press ctrl + space after command

For loopfor
If statementif
Main Methodmain
System.out.println()sysout

System.err.println()syserr
While statementwhile

Custom Templates

  • Logger

    • private static final Logger logger = Logger.getLogger(${enclosing_type}.class);