Useful Eclipse Java Code Templates

Posted by Jon on Stack Overflow See other posts from Stack Overflow or by Jon
Published on 2009-06-22T19:00:07Z Indexed on 2010/04/19 0:53 UTC
Read the original article Hit count: 396

Filed under:
|
|
|
|

You can create various Java code templates in Eclipse via the

Window->Preferences->Java -> Editor -> Templates

e.g.

sysout is expanded to:

System.out.println(${word_selection}${});${cursor}

You can activate this by typing sysout followed by CTRL+SPACE

What useful Java code templates do you currently use?
Include the name and description of it and why it's awesome.

There's an open bounty on this for an original/novel use of a template rather than a built-in existing feature.

  • Create Log4J logger
  • Get swt color from display
  • Syncexec - Eclipse Framework
  • Singleton Pattern/Enum Singleton Generation
  • Readfile
  • Const
  • Traceout
  • Format String
  • Comment Code Review
  • String format
  • Try Finally Lock
  • Message Format i18n and log
  • Equalsbuilder
  • Hashcodebuilder
  • Spring Object Injection
  • Create FileOutputStream

© Stack Overflow or respective owner

Related posts about java

Related posts about eclipse