[英]What's the shortcut to go to a class' method in Eclipse on a Mac?
Say I have this class, with a simple method. 说我有一个简单的方法这个类。
public class Constant {
...
public static int onePlusOne() {
return 2;
}
...
}
Then in another class, I do the following: 然后在另一堂课中,我执行以下操作:
public class Calculator {
...
public int calculate() {
return Constant.onePlusOne();
}
}
In AndroidStudio, if I hover to onePlusOne() in Calculator class, then press cmd + b
, then it will open Constant class, with the cursor right on the onePlusOne()
method. 在AndroidStudio中,如果我将鼠标悬停在Calculator类中的onePlusOne()上,然后按
cmd + b
,它将打开Constant类,并将光标移到onePlusOne()
方法上。
How do we do this in Eclipse? 我们如何在Eclipse中做到这一点?
hover to onePlusOne() in Calculator class, then press CTRL+ Click
the method. 将鼠标悬停在Calculator类中的onePlusOne()上,然后按
CTRL+ Click
该方法。
Or Press F3 或按F3
在Eclipse中,只需按住Ctrl并单击方法名称,或将光标放在方法调用中的某个位置,然后按F3即可 。
右键单击该方法,然后单击“打开声明”
Windows press and hold ctrl button and click on oneplusone(); Windows按住ctrl按钮并单击oneplusone();
Mac press and hold command button and click on oneplusone(); Mac按住命令按钮,然后单击oneplusone();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.