Summary of usage tips for Eclipse tools

Source: Internet
Author: User

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 positioning in a row (for people with programs over 100 have the gospel)
Ctrl+m maximize the current edit or view (and vice versa)
ctrl+/comment on the current line, and then uncomment it
Ctrl+shift+f formatting of the current code
F3 jump to the place of declaration or definition
F4 Display class diagram
Ctrl + Alt +↓ (↑): Copy line down (UP)

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-> check 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".
(5). Then, "File" → "Export", in the pop-up window select "Perferences" and 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 information about configuring eclipse
(9). Press "CTRL + F" shortcut key, enter ". ABC" and click "Find Next".
(10). Find the configuration information for ". ABC".
(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 just in the modified "TEST.EPF" file, click "Open", click "Finish". This step is similar to the export step above.
(13). Finally, of course, the code is tested. Just create a new project and create a new class.
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.

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

Work hard work Smart
Source: http://www.cnblogs.com/linlf03/
Welcome any form of reprint, without the consent of the author, please keep this paragraph statement!

Summary of usage tips for Eclipse tools

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.