Eclipse code reading shortcut

Source: Internet
Author: User
Http://www.cnblogs.com/hannover/archive/2009/11/19/1605760.html 1. CTRL + Left click

This is frequently used by most people to view the definitions of variables, methods, and classes.

2. CTRL + O

View the outline of a class and list its methods and member variables.Prompt: One more timeCTRL + OTo list the methods and variables inherited by this class.

Note: "O" ---> "outline" ---> "outline"

3. CTRL + T

View the inheritance relationship tree of a class, which is top-down, and pressCTRL + T,The display structure is changed from bottom to top.

Prompt: Select a method name and press Ctrl + T. You can view the parent class, subclass, and interface of the method with the same name.

Note: "T" -------> "Tree" -----> "Hierarchy Tree"

4. Alt + left and right direction keys

We often seeCodeCTRL + Left click, trace layers, and then get lost in the Code. In this case, you only need to press "Alt + left arrow key" to return to the last reading position. Similarly, press "Alt + right arrow key" to move to the returned reading position, just like the browser's forward and backward buttons.

5. CTRL + ALT + H

If you want to know whether a class method is called by other classes, select the method name and press CTRL + ALT + H ", eclipse will display the methods called by this method, and ultimately generate a call relationship tree.

Note: "H" ---> "hierarchy" ---> "Call level"

 

Http://hi.baidu.com/%C2%CC%CF%D0%BB%B0%D2%F4/blog/item/ed454cf90cfc4d54242df24b.html

 

 

CTRL + M:
Maximize the current window. With F12 (focus in the editing window), you can immediately maximize the code editing bar. (F12, CTRL + M)

F3:
Jump to the definition code of the identifier where the cursor is located. When reading by execution process, F3 implements most navigation actions. Press ctrl and then click the identifier.

Alt-left arrow:
Returns the last reading position. After you use the search or navigation function, you can use the alt-left arrow to return to the previous reading position, which is also a multi-level historical record. Similar to IE. To achieve the best efficiency, You need to develop the habit of using this function. For example, if you encounter a method call and use F3 to open its class file, after reading it, apply the alt-left arrow to move back, instead of directly turning off the newly opened tab. Otherwise, the new tab will be recorded in the history, and will be re-opened next time you move back here.

Alt-right arrow
Move forward to the next reading position in the history. Unlike the alt-left arrow function, this function is useful when the caller and the called are reading each other.

CTRL-Pageup/Ctrl-Pagedown
Switch to the previous/next tab

CTRL + F4 or Ctrl + W
Close current tab

CTRL + Shift + G
Find the location of the identifier that references the cursor in the workspace. It can be said that it is the opposite of the F3 shortcut. When reading by class definition, you can quickly find out which classes are called by the current class method.

CTRL + O
Search for class members in the current class definition. On the CTRL + O pop-up page, press Ctrl + O again to include the inherited class members in the search range (including the overwritten superclass ).

Open super implementation
Open the superclass method covered by the class method where the cursor is located, which is equivalent to using the overwrite method triangle icon on the left of the mouse in the overwrite method. There is no default shortcut key for this function. You must set it in the main menu windows> preferences> General> Keys> modify> command> navigate and open super implementation, my personal habits are Alt + M, U.

CTRL + Shift + T
Search for types in the workspace (including classes in all projects and reference classes in the jar package ). This is the quickest way to open a class by name.

F4
Open the inheritance tree. Displays the inheritance tree of the current class. Includes not only the parent class, but also the subclass of the current class.

Shift + ALT + q
Start a specific column. Shift + ALT + Q can be followed by a key to indicate the column to be opened. Press SHIFT + ALT + q and you will see the prompt window later.

CTRL + J
Incremental search. Perform incremental search in the current editing window. During the search process, press the arrow to jump to the next matching point, press the top arrow to jump to the previous matching point, and Press ESC to exit the incremental search.

CTRL + H
Open the search window. Open a Search dialog box for detailed settings. Due to the excellent navigation functions of Eclipse, I rarely use this search function. It is mainly used to search for conditions using regular expressions. In the search, use Ctrl + k to find the next match.

Show selected element only
Displays only the elements where the cursor is located (class methods, etc ). Hide other parts of the current Code and display the class method of the cursor at the top. I personally prefer this method. First, the screen is relatively clean, and second, when using the navigation function to navigate to the class method, it must be set to top display. Third, you can force yourself to get used to the navigation function (F3, alt + left and right arrows), instead of dragging the scroll bar habitually. Cancel this method again.
There is no default shortcut key for this function. You must set it in the main menu windows> preferences> General> Keys> modify> command> navigate and open super implementation, my personal habits are Alt + M, S.

CTRL + keypad + -*/
Control code structure folding and expansion. Because I personally like to use show selected elemnt only for more code folding, and to view the class member structure, you can use outline columns (SHIFT + ALT + Q, O) or Ctrl + O. Therefore, this function is rarely used. It is mainly used to view inline javadoc comments of class methods in a centralized manner.

CTRL + E
A simple dialog box is displayed to precisely switch the code editing bar. (Do not accidentally press Ctrl + W to close the current column. You can consider canceling Ctrl + W to close the settings of the current column, because Ctrl + W is too easy to press by mistake. I personally prefer to use Ctrl + F4 to close the topic)

CTRL + Shift + E
A dialog box is displayed to switch to or close multiple code edit columns.

Of course, there is also the most basic, CTRL + Shift + L, display the shortcut key list.

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.