The "Go" eclipse Tool usage Tips Summary

Source: Internet
Author: User

Work hard work Smart
Source: http://www.cnblogs.com/linlf03/

Refer to Http://www.codeceo.com/article/eclipse-tips.html

First of all, I recommend a very good how-to-use Eclipse article, which is about the various aspects of Eclipse, very practical, recommended to everyone!

First, commonly used shortcut keys:
Ctrl+f11 Run
ctrl+shift+/Add/* In the Code window ... */comment
ctrl+shift+\ Elimination/* ... */comment
Ctrl+shift+o Add the missing import statement to ctrl+1 Quick fix (the most classic shortcut, don't say more)
Ctrl+l positioned in a row (for people with programs over 100 have the gospel) ctrl+d Delete when moving forward
Ctrl+m maximize the current edit or view (and vice versa)
ctrl+/comment on the current line, and then uncomment it

Enter a pair of symbols, such as "", (), will be auto-complete, input after the Jump: tab

Find out who is calling a method: Select the method name, Ctrl+shift+g

Back to the last edit point, the shortcut key is Ctrl+q
Ctrl+shift+f formatting of the current code
F3 jump to the place of declaration or definition
F4 display the class diagram, or select the class ctrl+t

Ctrl+shift+r Find a class or file by file name:
Ctrl + alt +↓ (↑): Copy the line down (UP) alt +↓ (↑): Move down (UP) to the bank

Second, the breakpoint debugging shortcut keys:
F5 Step Into Single step
F6 Step over Single step skip
F7 Step Return Stepping Out

Three, common configuration:
1. Display line number: Window->preferences>general->editors->text editors-> (or CTRL+F10) tick show lines numbers
2. Enhanced code Auto-hint function for Eclipse and MyEclipse


Windows→preferences→java→editor→content Assist
The default value for Autoactivation delay is 200 (in milliseconds) which means "." Then stay 200 milliseconds before IntelliSense prompts appear. Then change it to 20 and the prompt will increase significantly.

Principle: "Auto Activation triggers for Java" This option refers to the option to trigger the code hint, change "." To ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (,", It means encountering 26 letters and. (These symbols trigger the code hinting function.) (specifically, say, rest assured) enhanced Eclipse, MyEclipse code hints function, specifically how to configure? Let's start with steps.
(1). Open eclipse, then "window" → "Preferences"
(2). Select "Java", expand, "Editor", and select "Content Assist".
(3). Select "Content Assist" and see the "Auto Activation triggers for Java" option under "Auto-activation" on the right and right. Actually, it means "." is the trigger code hint. This symbol.
(4). "Auto Activation triggers for Java" option in "." After the addition of ABC letters, convenient to find the following changes. Then "Apply" and click "OK".

Summary: The "Auto Activation triggers for Java" option refers to the option to trigger the code hint and "." Change to ". ABCDEFGHIJKLMNOPQRSTUVWXYZ (," means that it encounters 26 letters and.) (These symbols trigger the code hinting function.) By the way, modify the class name, interface name, etc. in different colors highlighted, can be configured in the "Java" → "Enditor" → "Syntac", the right to expand "Java" → "classes", tick "Enable" this option, choose their 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 things can be configured, so that MyEclipse optimization, specific to each person according to their own personal preferences to configure.

3. create a working space for each project

File->switchworkspace 、、、 "File" → "Export" and select "Perferences" in the popup window.


Four, MyEclipse font settings
In Window->perferences->general->appearance->colors and fonts->text Font Click Change Modify

V. How to open a Java project in eclipse

Use File > Import and select General > Existing Projects into Workspace. Click Next and then browse to the directory contain the project directory.

Vi. Call Stack in Eclipse

In the "Debug Perspective", show the View named "Debug". For each thread, which is a currently halted, this view shows the full call stack. Clicking on one element of this stack switches the editor view to display the corresponding class, and "variables" view WI ll show variables of this stack element.

Seven, debugging skills (from CSDN)

1.Step into (also F5) jump
2.Step over (also F6) skip
3.Step return (also F7) executes the current method, and then return jumps out of this method
4.step filter Progressive filtering is performed until an unfiltered position or breakpoint is encountered (set Filter:window-preferences-java-debug-step Filtering)
5.resume restarts debug and runs until breakpoint is encountered.
For example: A and B two breakpoints, the debug process found a breakpoint is useless, remove a breakpoint, run resume will skip a directly to the B breakpoint.
6.hit count set execution times for a for loop in the program (set breakpoint view-right-click count)
7.inspect check operation. Executes an expression that displays the execution value
8.watch real-time monitoring of changes to objects, methods, or variables
9. The breakpoint (breakpoints) We often say is the line breakpoints, except for line breakpoints, there are other types of breakpoints: field (Watchpoint) Breakpoint,method Breakpoint, exception breakpoint.
10.field Breakpoint also known as watchpoint (monitoring point) suspend when member variable is read or modified
11. Add method Breakpoint Suspend (Run-method breakpoint) when entering/leaving this approach
12. Add exception breakpoint Catch the Execption when the suspension (to be continued ...)
Breakpoint Properties:
1.hit count execution number of times after suspend for loop
2.enable condition meet your input criteria (for ture/change) on hold
3.suspend thread Multi-threaded when this threads are suspended
4.suspend VM suspend Virtual machine

Variables in the 13.variables view can change the value of the variable, and the variables view selects the variable right-click--change value. Once for quick commissioning.
The 14.debug process modifies some code after the--〉save&build-->resume--> is re-suspended on the breakpoint
15.resume when debug debugging runs out of exception, run resume and start debugging again from the breakpoint

Viii. advanced debugging Techniques for Eclipse

The "Go" eclipse Tool usage Tips Summary

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.