Idea small hint

Tired of writing private static final Logger LOG = Logger.getLogger(SomeClass.class);? So you probably already use Live templates - if not try to type in Java Editor sout that press Tab, or Ctrl+J than find psvm - really cool, but there is some hints to learn anyway.
Let see our logger example:
private static final Logger LOG = Logger.getLogger(SomeClass.class);

We want to have a Live Template called log which will type this into our Java code, so:
1) in settings find Live Templates, than press Add...
2) in popup choose the group, check the Java code context, and make sure that Shorten FQ names is checked
3) as a template text type:
private static final org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger($CLASS$.class);
4) in Edit variables for CLASS variable choose className() as expression
Thats all - check the LT in Java class as log + TAB.

Recent comments