Here are some tips for using eclipse. Eclipse is an open-source plug-in-based project with powerful functions. Apart from Java, You can compile most common languages by installing plug-ins, it can be said that it is a very powerful and comprehensive IDE development tool. Therefore, it is necessary to introduce some of its usage skills to facilitate development.
These skills include common menus, interface operations, and shortcut keys.
Eclipse can create multiple work zones. Each work zone is a file directory, and all related files are stored in this directory. A dialog box will prompt you to select a work zone at startup. After starting, you can see the workbench. The workbench contains multiple perspectives, and each perspective contains multiple different windows.
Eclipse can set the file association to open the program. the operation method is window-> preferences-> General-> editors-> file associations.
Eclipse can switch between methods as independent editing units and classes as editing units. Operation Method: Click the [show source of selected element only] button.
The eclipse window can be resized and restored by clicking the label in the upper right corner, similar to the window operation.
In eclipse, you can perform directory folding and recovery. To do this, click collapse and restore labels at the top of the view.
Eclipse provides the automatic refresh function to avoid manual Refresh after files are changed outside eclipse each time. The operation method is window-> preferences-> General-> Workspace-> refresh automatically selected.
Open a Java file in eclipse and click an element (class, method). The source code of this element is displayed in the deconfigurtion window, similar to the previous open deconfigurtion function (by pressing CTRL + the left mouse button ). In addition, the javadoc of this element can be displayed in the javadoc view.
The line number can be displayed in eclipse. For details, choose Window> preference> General> editors> text editors> show line numbers.
Eclipse provides a powerful Java code Formatting Function. The configuration method is window-preference-> JAVA-> code style-> formatter.
Eclipse provides the annotation hiding function. You can use window-preference-> JAVA-> Editor-> folding-> to select the Enable folding configuration, but when it is hidden, the code lines may be inconsistent during code debugging. Therefore, we recommend that you do not use this function.
Eclipse provides the dynamic highlight function for the selected elements. After an element is selected, all calls to this element in the editor are highlighted. The configuration method is as follows: window-preference-> JAVA-> Editor-> MARK occurrences.
Eclipse browsing window mainly includes: navigator, package explorer, project explorer, hierarchy,
Common shortcut keys in Eclipse: Alt + arrow up (down), CTRL + Shift + x (Y ),
During debugging in eclipse, you can right-click the variable that you want to display the result, and perform the corresponding operations in the pop-up drop-down menu. You do not need to perform the operations in the corresponding window.
During debugging in eclipse, you can select the system thread filter to filter out the system threads from the debugging view.
In eclipse debugging, you can directly modify the value of a variable in the variable view and save the changes to take effect.
You can compare two files in eclipse by selecting two files, right-clicking and selecting compare-> each other.
The following describes how to use the shortcut key:
CTRL + 1 quick fix (the most classic shortcut, you don't need to talk about it)
CTRL + D: Delete the current row
CTRL + ALT + ↓ copy the current row to the next row (copy added)
CTRL + ALT + ↓ copy the current row to the previous row (copy added)
Alt + ↓ interaction position between the current row and the following row (especially practical, you can save cutting and pasting)
Alt + ↑ interaction between the current row and the previous row (same as above)
Alt + ↓ previous edited page Alt + → next edited page (of course for the previous one)
Alt + enter display the properties of the currently selected resource (project, or file)
Shift + enter insert empty rows in the next row of the current row (the mouse can be at any position of the current row, not necessarily the last row)
Shift + Ctrl + enter insert blank lines in the current line (same principle)
CTRL + q locate the last edit location Ctrl + l locate in a line (for more than 100 of the program, there will be a good news)
CTRL + M maximize the current edit or view (then press it, and vice versa)
CTRL +/comment out the current row, and then press it to cancel the comment
CTRL + O quick outline display
CTRL + T quickly display the inheritance structure of the current class
CTRL + W disable the current editer
CTRL + k quickly locate to the next one by referencing the selected word
CTRL + E: Click it to quickly display the drop-down list of the current editer (if the current page is not displayed, it is displayed in bold)
CTRL +/(keypad) collapse all code in the current class
CTRL + × (keypad) show all the code in the current class
CTRL + Space Code assistant inserts some code (but it is usually in conflict with the input method. You can modify the key of the input method or replace it with ALT +/for the moment)
CTRL + Shift + e display the managers that manage all Opened Views (you can choose to close or activate them)
CTRL + J forward incremental search (after pressing CTRL + J, each letter editor you enter provides a quick match to locate a word. If not, it is not found in stutes line. It is particularly useful when querying a word. This function was available two years ago)
CTRL + Shift + J reverse incremental search (the same as the previous one, but only from the back to the front)
CTRL + Shift + F4 close all open editer
CTRL + Shift + x change all selected text to lowercase
CTRL + Shift + y change all selected text to lowercase
CTRL + Shift + F format the current Code
CTRL + Shift + P locate the matched character (for example, {}) (when positioning from the front, the cursor must be inside the matched character, followed by the front, and vice versa) CTRL + Shift + R find files
CTRL + Shift + t the shortcut keys under the search class are commonly used in refactoring, and I like them and often sort them out (Note: Generally, the shortcut keys for refactoring start with ALT + shift)
Alt + Shift + R Rename (one of my favorite ones, especially the rename of variables and classes, which saves a lot of labor compared with manual methods) alt + Shift + M extraction method (this is one of the most common methods in refactoring, especially useful for a lot of mud code)
Alt + Shift + C modify the function structure (more practical. N functions call this method and modify it once)
Alt + Shift + L extract local variables (you can directly extract some magic numbers and strings into one variable, especially when multiple calls are performed) alt + Shift + F convert the local variable in the class into the field variable (more practical function
) Alt + Shift + I merge variables (this may be a bit inappropriate, inline)
Alt + Shift + V moving functions and variables (not commonly used)
Alt + Shift + z restructured regret medicine (UNDO)