Java Learning ecplise IDE Tips (2) Chapter II: Keyboard shortcuts, code assist

Source: Internet
Author: User

Previous: Java Learning ecplise IDE Tips (1) Chapter One: My turf, my work space.Chapter Two: keyboard shortcuts, code assistContent includes: First: Show line numbers

How to set the line number: Ecplice menu Windows>preferences>general>editors>text editors> Check out show lines Numbers

Second: Create more powerful code hints

General, Stupid method is: Enter a few letters and then hold alt+/

How to set up automatic prompts:

The default configuration is:

Ecplice menu Windows>preferences>java>editors>content Assist>auto activation triggers for Java > English input Period

We change to:

Ecplice menu Windows>preferences>java>editors>content Assist>auto activation triggers for Java > Abcdefghijklmnopkrstuvwxyz.

Notice the end of the English period.

Mentioned: mechanized production, industrial production and information production, the original boring and repetitive work, by the machine to do, no one to do, those machines and computers can not do, then someone to do. This greatly improves the productivity and increases the production capacity.

Third: Quick Notes

Line Comment: ctrl+/

Block Comment: ctrl+shift+/removal ctrl+shift+\

Mouse Line Comment shift+ left button

IV: Quick Switch window

How to max/Minimize edit window, debug window with Java window

Ctrl+m

Ctrl+f6 This can choose to switch between different files, especially when the file is more convenient.

V: Fast capital letters, lowercase letters

Select and Ctrl+shift+y, then press again to revert to the original. All into lowercase

Ctrl+shift+x, all of it into uppercase.

Sixth: Quickly process line codes

Ctrl+d quickly delete the current line code

Ctrl+alt+ the next arrow key to copy the current line to the next line (optionally multiple lines)

Ctrl+alt+ up ARROW key to copy the current line to the previous row (optional multiple lines)

ALT + DOWN ARROW key to quickly extract a line of code to the bottom of the specified position

ALT + UP ARROW key to quickly extract a line of code to the top of the specified position

Seventh: Fast abdominal Writing Super-class method

When inheriting a class, it is used.

Ecplice Menu Source>overirde/implement Methods

Eighth: Batch generation of Get, set methods

When accessing variables for an entity class, use the Get, set method, because Java prohibits direct access to entity class variables.

Each variable is written with a GET, Set

Ecplice menu Source>generate Getters and Setters

Nineth: Quickly generate constructors

Ecplice Menu Source>generate Constructors from superclass

Tenth: quickly generate import

Ctrl+shift+o

11th: Quickly generate Javadoc annotations

Directly select the functions, variables, parameters, and alt+shift+j that you want to annotate, and automatically add comments directly.

12th: Using Code templates

1. Check the code first, Alt+shift+z, you will be prompted to select the code module to use; Do,while,for,try, etc.

For example, exception handling in Java, first write Try/catch

2. Code blocks can be customized.

Example: Customizing a code module for a function run time fragment

The code is as follows: (there is a problem with this block code in the video.) So take a look at it. )

Template Name: Timestamp

Code block:

Long _start = System.currenttimemillis ();

${line_selection}${cursor}

Long _end = System.currenttimemillis ();

System.out.println ("time =" + (_end-_start));

13th: Operation edit Window

Ctrl+w Close the window, do not click X to close the mouse.

Ctrl+shift+f4 Close all open editon

14th: Quick Rename

F2 rename Java packages, projects, programs.

Ecplice menu File>rename (F2)

15th: Go back to the last edit point

Ctrl+q, this method, the larger the program, the more obvious the effect.

Summarize:

In programming, speed is important. Increase programming speed and improve time utilization. When the program is small, dozens of lines, we do not pay attention to these; when we program 300 lines, thousands or even tens of millions of times, these fragmented auxiliary programming a big problem, will seriously affect the efficiency of programming development, resulting in longer project development time. Through the configuration, we make this small and tedious work, in bulk, from freeing human resources to more swimming places.

Time is MONEY!!!

Java Learning ecplise IDE Tips (2) Chapter II: Keyboard shortcuts, code assist

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.