Eclipse commonly used shortcut keys and debugging methods (although now can not understand, but it will definitely be used in the future, the first turn)

Source: Internet
Author: User

Common shortcut keys

Eclipse's full keyboard shortcuts, familiar with shortcut keys, can help you develop more and save more time to do meaningful things.

  • Ctrl+1 Quick Fix (the most classic shortcuts, you don't have to say more)
  • Ctrl+d: Delete When moving forward
  • Ctrl+alt+↓ Copy the current row to the next row (replication incremented)
  • Ctrl+alt+↑ Copy the current line to the previous row (replication incremented)
  • Alt+↓ the current line and the next line of interaction (especially useful, can be omitted first cut, then pasted)
  • Alt+↑ the current line and the upper row interaction position (IBID.)
  • alt+← the previous edited page
  • alt+→ next Edit page (of course, for the above article)
  • Alt+enter displays the properties of the currently selected resource (project, or file or file)
  • Shift+enter inserts a blank row on the next line of the current row (at which point the mouse can be at any position in the current row, not necessarily the last)
  • Shift+ctrl+enter Insert blank line in current line (principle above)
  • Ctrl+q positioning to the last edited place
  • 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+o Quick Display OutLine
  • Ctrl+t quickly displays the inheritance structure of the current class
  • Ctrl+w Closing the current editer
  • Ctrl+k the selected word quickly navigates to the next
  • Ctrl+e quick display of the current Editer drop-down list (in bold if the current page does not appear)
  • ctrl+/(numpad) collapses all code in the current class
  • Ctrl+x (keypad) expands all code in the current class
  • Ctrl+space Code Helper to complete the insertion of some code (but the general and IME conflict, you can modify the input method hotkey, you can also take up alt+/to replace)
  • Ctrl+shift+e Display manager that manages all of the currently open view (you can choose to close, activate, and so on)
  • Ctrl+j forward Incremental lookup (after pressing CTRL+J, each letter editor you enter provides a quick match to navigate to a word, if not
  • There, then in the Stutes line display did not find, check a word, especially practical, this function idea two years ago.
  • CTRL+SHIFT+J Reverse incremental lookup (same as above, except forward)
  • Ctrl+shift+f4 Close all open editer
  • Ctrl+shift+x all the currently selected text to uppercase
  • Ctrl+shift+y turns the currently selected text to lowercase
  • Ctrl+shift+f formatting of the current code
  • Ctrl+shift+p positioning to the match (for example {}) (from the front to the back, the cursor in the match, back to the front, or vice versa) the following shortcut keys are commonly used in refactoring, I like and commonly used to tidy up (note: General refactoring shortcut keys are ALT + Shift-Start)
  • Alt+shift+r rename (is my own favorite, especially the variables and classes of rename, than the manual method can save a lot of labor)
  • Alt+shift+m Extraction Method (This is one of the most common methods of refactoring, especially useful for a whole bunch of mud codes)
  • Alt+shift+c Modify the function structure (more practical, there are n functions called this method, modified once done)
  • Alt+shift+l extract Local variables (you can directly extract some magical numbers and strings into a variable, especially when multiple calls are made)
  • Alt+shift+f change the local variable in class to a field variable (more useful 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 reconstruction of Regret medicine (Undo)

Several eclipse debugging tips that you want to be useful to Java programmers.

1 Conditional breakpoints

If you don't know how to add a breakpoint, just click on the left panel (preceded by the line number) and the breakpoint is created. In the debug interface, the Breakpoints view lists all the breakpoints that were created. We can add a Boolean condition to it, that is, the breakpoint will be activated and if the Boolean condition is true, the breakpoint will be executed, otherwise it will skip execution.

2 Exception Breakpoint

In the Breakpoints view, there is a j! tag button! We can use this button to add a Java exception breakpoint. For example, we want the program to continue debugging when it encounters a null pointer exception (nullpointerexception), so we can use the button to add an exception breakpoint!

3 Monitoring points

This is a very good feature when the selected property accesses or modifies the program, and the program stops execution and allows debugging. Selecting a class variable in the outline view and selecting toggle Watch from the context menu will create a property watch that will be displayed in the breakpoint (breakpoints) view as a list of all the watch points.

4 Evaluation/Inspection

Press Ctrl+shift+d or Ctrl+shift+i to display the value of the selected variable or expression. We can also add permanent observers to a variable or expression, and when the program is debugging, the observers are displayed in an expression view.

5 Modifying variable values

During the debugging process, we can modify the value of the variable. Select a variable and then enter the variable view (Variables view), and enter the value in its corresponding value joins according to the variable type.

6 Drop to Frame

During debugging, you can jump back to the beginning of the call stack frame and the value of the variable will return to the original. Depending on the depth of the stack, the main use of this feature is that all variable states can quickly return to the way the method starts executing, and then you can do it over and over again, so that you can debug multiple times in your area of interest, but there are some side effects during execution. For example, the data inserted into the database can not be deleted!

7 entering, jumping and returning

    • f5--Enter: Moves to the next step, if the current row has a method call, the control jumps to the first line of the called method execution.
    • f6--jumps: Moves to the next line. If there is a method call on the current line, it is moved directly to the next line. Does not enter inside the called method body.
    • f7--returns: Jumps out of the current method and continues down execution.
    • f8--moves to the next breakpoint to execute.

Eclipse commonly used shortcut keys and debugging methods (although now can not understand, but it will definitely be used in the future, the first turn)

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.