hi
I often find myself adding "print debug statements" to my code like this:
public class SomeClass
{
public void someMethod()
{
System.out.println("SomeClass.someMethod() : some info");
}
}
I already used the default "sop" code template to help me with that.
Now I have been able to configure my own code template that also adds the class name and method name automatically.
I don't know how to export code templates so I'll try to describe it:
In the "Preferences" dialog on the "Code Editor > Code Templates" pane I added a Shortcut "sopl" with Description "System.out.println logging".
On the "Code" tab I added:
System.out.println("$myCurClass$.$myCurMethod$() : " + $end$);
On the "Variables" tab I configured:
Name="myCurClass", Type="curClass", Default Value="x", Editable=<unchecked>
Name="myCurMethod", Type="curMethod", Default Value="x", Editable=<unchecked>
So, if I type "sopl" in my Java code followed by Ctrl+Enter I can add my log statements faster.
I'll probably configure some similar code templates for using Log4J and such.
Maybe someone else finds this usefull.
(using JDeveloper version 10.1.3.1.0.3984)
regards
Jan Vervecken