eclipseと同じ機能を自動的に生成して出力するSystem.out.println(ClassName::MethodName <then my message>)
機能 (コンソールでデバッグするためのクラス名とメソッド名を出力します) がNetbeansにもあるかどうかを知りたいです。
たとえば、Eclipse エディターでは、次のように入力します。
システム + Ctrl+Space
コンソールに System.out.println(ClassName::MethodName ) タイプの出力を自動生成します。
そのような方法はNetbeansで利用できますか?
現在、Netbeans には 2 つのメソッドしかありません。
南+Tab
(System.out.println()) および
soutv +Tab
(System.out.println(行のすぐ上で使用される変数を出力します)) 自動的に。
言い換えると、myMethod1 の代わりに、囲んでいるメソッド名を取得したいのです。
例えば。:
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).
}
}
アップデート:
次のコード テンプレートを使用します。
syst = System.out.println("${classVar editable="false" currClassName default="getClass()"}");
クラス名を出力できますが、メソッド名の手がかりはまだありません。