如何在IntelliJ中查看JDK中的特定Java源代码文件?

huangapple go评论88阅读模式
英文:

How do I view a specific Java source code file from the JDK in IntelliJ?

问题

假设我想打开 java.lang.ClassLoader 以查看它的方法是如何实现的。

其中一种我找到的方法是使用 Ctrl+Shift+F 快捷键,将 Scope 更改为 All Places,然后在上方输入包路径。这将生成一个列出引用此包的所有类的列表。点击在字段声明中使用该包的类会打开那个类,然后我可以使用 Ctrl+left_mouse_click 单击类名,最终会带我进入所需的 ClassLoader 类。

是否有一种不太复杂的访问该类的方法?

我已经在Google、Stackexchange、IntelliJ文档中进行了搜索,并浏览了菜单栏,但迄今为止还没有找到任何信息。我相信这一定有文档记录的地方,但我可能没有使用正确的搜索词。

英文:

Say I want to open java.lang.ClassLoader to see how its methods were implemented.

One method I've found for doing this is by using the Ctrl+Shift+F shortcut, changing Scope to All Places, and typing in the package path above. This will generate a list of classes that reference this package. Clicking a class that uses the package in a field declaration opens up that class, from which I can Ctrl+left_mouse_click the class name, which finally takes me to the desired ClassLoader class.

Is there a less convoluted way of accessing the class?

I've searched on Google, Stackexchange, the IntelliJ documentation, and looked through the menu bar, but haven't found anything so far. I'm sure this must be documented somewhere, but I may not be using the right search terms.

答案1

得分: 1

你可以使用导航 -> 转到类...:

如何在IntelliJ中查看JDK中的特定Java源代码文件?

然后输入 ClassLoader 来查找它(确保范围设置为“所有位置”):

如何在IntelliJ中查看JDK中的特定Java源代码文件?

默认映射为 Ctrl + N(但我使用的是 Eclipse 快捷键设置,所以对我来说是 Ctrl+Shift+T)

英文:

You can use Navigate -> Go to class... :

如何在IntelliJ中查看JDK中的特定Java源代码文件?

and then type in ClassLoader to find it (make sure scope is set to 'All Places'):

如何在IntelliJ中查看JDK中的特定Java源代码文件?

The default mapping is Ctrl + N (but I'm using the Eclipse keymap, so for me it's mapped to Ctrl+Shift+T)

答案2

得分: 1

你只需按下<kbd>CTRL</kbd>+<kbd>N</kbd>。

以下是详细的回答:在IntelliJ中导航到类型

英文:

You just need to press <kbd>CTRL</kbd>+<kbd>N</kbd>

Here is the detailed response Navigate to a Type in IntelliJ

huangapple
  • 本文由 发表于 2020年9月6日 21:08:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/63764508.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定