Code hints
Menu Window--perferences. Keys, select the item in the middle of the command name called Content Asssist, and press the shortcut key you want to set in the following binding: Shift + Space, then click Apply or OK to save the settings.
When the shortcut key is set, click on the binding of the list list to sort by the shortcut key name to see if there are any other shortcut keys to repeat.
Common templates for code hints can be found in the Perferences window, Editor-and templates, Java, such as the first item in the Templates list, the item named Main, The content in the preview below is a template for the main method.
Type the word main in the Java file and type the code hint shortcut SHIFT + Space set above, and the Eclipse edit page will pop up the prompt panel, select the desired prompt and enter OK.
At this point eclipse will automatically generate the template for this main method for us:
Fast execution of main, test, etc.
If we write a test using the main method, you need to do it immediately, you can click on the toolbar to execute the main method of the button
You can also use the shortcut keys to quickly execute: Alt + Shirt + X, release and type J, by default, the Main method in the currently edited Java class is executed.
If you are currently editing a JUnit test class, you can quickly execute the test method in the JUnit class by using ALT + Shirt + X, releasing and typing T.
Document positioning, expanding, and collecting project tree
Quickly locate the currently edited file in a tree-structured project: Press the button in the left panel,
The project tree expands and highlights the current file. To close the expanded tree you can click on the previous button.
Add a View
Accidentally shut down the console or need to use other views provided by Eclipse, point menu window–> Show View, select the view you want to add.
File in a local historical version
For files that have been deleted and have not yet been uploaded to CVs or SVN, right click on the folder where the files are located select Restory from the Local history ..., select the files that need to be recovered.
If you want to view the history of the file locally, you can right-click on the file and select team--Show Local
Highlight selected objects in a class
Press the button in the toolbar or use the shortcut key ALT + Shift + O to turn on or off highlighting of the current contents of the cursor in the class, such as the Allshowchildren object in.
Recompile project
Sometimes an unconventional error or phenomenon in the project causes it to fail to start or compile properly, and you can try to empty and recompile the entire project's compilation environment, project--clean .... Working status Make sure that the following build automatically is selected
Debugging
Double-click the blue bar or row count display area on the left side of the editor to place a breakpoint on the area where you want to debug
Run the program when you go to the point where the breakpoint will be paused to continue execution, press F6 will be in the method body line down execution, if you want to trace into the call to the method inside the F5, let the program continue to press F8. Select an object or a complete method body Press CTRL + Shift + I to view the return value information for the selected code.
or view object information for the current life cycle in the variables view.
Common shortcut keys
Save file: Ctrl + S
Find resources across Eclipse: Ctrl + H
To refresh a folder in the project tree: Select F5
Find the source file for the entire Eclipse Open project: Ctrl + Shift + R
Find resources in the entire eclipse context: Ctrl + Shift + T
File formatting: Ctrl +shift + F
Automatic import of all non-declared import classes: Ctrl + Shift + O
Generate a Get, set method for the properties of the Pojo class: Alt + Shift + S, select Generate Getters and Setters
Automatically implement empty methods for inherited abstract classes or interfaces: Alt + Shift + S, select Override/implement Methods ...
Find a string in the current file: Type Ctrl + K after the string is selected, look up type Ctrl + Shift + K
Switch to a file you edited before or after: Alt +←,alt +→
Viewing Java Doc documents for objects, methods, etc. in Java files: F2 after cursor positioning
Find the source of an object, method declaration: F3 after cursor positioning (if the interface method can only navigate to the interface)
View all the declaration information for an object or method: Right-Declarations after the cursor is positioned, select the lookup scope, usually project (if it is an excuse to find excuses and all implementation classes)
See where the method was called: Right-Reference after the cursor is positioned, select a lookup range, typically project
Select "Java", expand, "Editor", and choose "Content Assist".
3. Select "Content Assist" and see the "Auto" under "auto-activation" on the right, right
Activation triggers for Java "this option. Actually, it means "." is the trigger code hint. This symbol.
4. "Auto Activation triggers for Java" option in "." After adding ABC letter, easy to find in the back
Modify. Then "Apply" and click "OK".
5. Then, "File" → "Export", in the pop-up window select "Perferences", click "Next".
6. Select the export file path, I export to the desktop, enter "test" as the file name, click "Save".
7. On the desktop, locate the file "TEST.EPF" that you just saved, and right-select "Open with Notepad."
8. You can see a lot of configuration MyEclipse 6.0.1 information
9. Press "CTRL + F" shortcut key, enter ". ABC" and click "Find Next".
10. Find the configuration information for ". ABC" as follows:
As follows:
11. Change ". abc" to ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (,", Save, Close "TEST.EPF").
12. Go back to MyEclipse 6.0.1 interface, "File" → "Import", in the pop-up window select "Perferences", click
"Next", select the "TEST.EPF" file that has just been modified, click "Open", click "Finish". This step and the above
The export steps are similar.
13. Finally, of course, the code is tested. Just create a new project and create a new class. In code input Switch,foreach, etc.
Test. You will immediately find that the hint, and no matter which letter will have a lot of relevant hints, very smooth, very square
Will exactly
Summarize:
The "Auto Activation triggers for Java" option refers to the option to trigger the code hint and "." Change into
". ABCDEFGHIJKLMNOPQRSTUVWXYZ (," means that it encounters 26 letters and.), (these symbols trigger the code hinting function
I can do it.
By the way, modify the class name, interface name, etc. to be highlighted in different colors, can be configured in "Java" → "Enditor" →
"Syntac", on the right side expand "java" → "classes", tick "Enable" this option, choose your favorite color.
There are, of course, other related color configurations. Not to mention it in detail. In fact, in the "Preferences" this thing, there are many can be configured
Things, so that myeclipse optimization, specific to each person according to their own personal preferences to configure the
Eclipse shortcut keys