How to implement the "System.out.println(ClassName::MethodName <then my message>)" of Eclipse in Netbeans?

Posted by Sen on Stack Overflow See other posts from Stack Overflow or by Sen
Published on 2012-10-17T10:35:16Z Indexed on 2012/10/30 5:02 UTC
Read the original article Hit count: 161

Filed under:
|

I would like to know if there is the same feature as in eclipse to automatically generate and print the System.out.println(ClassName::MethodName <then my message>) functionality (which will print the class name and method name for debugging in the console) in Netbeans also.

For example, in Eclipse Editor, Typing

syst + Ctrl+ Space

will auto generate a System.out.println(ClassName::MethodName ) type output in the console.

Is such a method available in Netbeans?

As of now, I have only two methods here in Netbeans:

sout + Tab

(System.out.println()) and

soutv + Tab

(System.out.println(prints the variable used just above the line)) automatically.

Let me rephrase, instead of myMethod1, I want to get the enclosing method name.

Eg. :

public class X {

  public void myMethod1(int a) {
    System.out.println(X::myMethod1()); // This should be produced when I type the Code-Template abbreviation (example: syst) and press tab (or corresponding key).
  }
}

public class Y {

  public void myMethod2(int b) {
    System.out.println(Y::myMethod2()); // This should be produced when I type the Code-Template abbreviation (example: syst) and press tab (or corresponding key).
  } 
}  

Update:

With the following code template:

syst = System.out.println("${classVar editable="false" currClassName default="getClass()"}");

I am able to print the classname, but still no clue for the Method name.

© Stack Overflow or respective owner

Related posts about java

Related posts about netbeans