您的位置:首页 > 编程语言 > Java开发

Eclipse 常用快捷键

2007-11-15 15:22 225 查看
摘录自帮助文档的JAVA编辑时最有用的快捷键

Quick Outline
Press Ctrl+O or select Navigate > Quick Outline and you will see an in-place outline of the current source file.

Press Ctrl+O a second time and all inherited fields, types and methods are shown as well. Inherited members are shown in grey.
Start typing while the quick outline view is shown to filter the list of displayed elements. Further, use the arrow keys to navigate in the outline view and press Enter to reveal the selected element in the Java editor.

Using content assist

With your cursor at the end of the word assert, press Ctrl+Space to activate content assist. The content assist window with a list of proposals will appear. Scroll the list to see the available choices.
With the content assist window still active, type the letter 't' in the source code after assert (with no space in between). The list is narrowed and only shows entries starting with 'assert'. Single-click various items in the list to view any available Javadoc help for each item.

Quick Fix

Click to place the cursor onto the highlighted error, and choose Quick Fix from the Edit menu bar. You can also press Ctrl+1 or left click the light bulb. A selection dialog appears with possible corrections.

Using code templates

With the cursor at the end of for, press Ctrl+Space to enable content assist. You will see a list of common templates for "for" loops. When you single-click a template, you'll see the code for the template in its help message. Note that the local array name is guessed automatically.

Open Declaration

On the first line of the MoneyTest class declaration, select the superclass TestCase and either
from the menu bar select Navigate > Open Declaration or
press F3.

Open Type Hierarchy

With the TestCase.java editor open and the class declaration selected:
from the menu bar select Navigate > Open Type Hierarchy or
press F4.

Quick Type Hierarchy

Press Ctrl+T or invoke Navigate > Quick Type Hierarchy and the in-place type hierarchy view is shown.
Pressing Ctrl+T while the type hierarchy view is shown will toggle between supertype hierarchy and subtype hierarchy.
To see where a virtual method call can resolve to:
Press Ctrl+T or invoke Navigate > Quick Type Hierarchy and the in-place type hierarchy view is shown.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: