12 tips for efficient use of eclipse

Source: Internet
Author: User

The integrated development Environment (IDE) makes application development easier. They emphasize the syntax and let you know if you have a compilation error, allowing you to step through the code in many other things. Like all Ides, Eclipse has shortcuts and gadgets that make you feel a lot easier. There are too many eclipse tips, and here are a few of the daily uses:

1. AutoComplete--eclipse has an auto-complete code function, and the shortcut key is CTRL + SPACE. A dialog box pops up when clicked, with some suggestions related to contextual. As long as there is a possibility, eclipse will do it for you.

2. Quickly format your coding --If the code is modified a lot, it becomes very difficult to see. Without proper indentation, it is difficult to determine what has changed in the code. The formatting code can be used with the shortcut key CTRL + SHIFT + F. You can even set your own format by going to the Project>preferences>java Code style>formatter menu, selecting the "Enable Project specific settings" option, Then edit your own format and save it with a new name.

3. Eliminate unnecessary coding -if a project is poorly maintained and often modified, it introduces a lot of unnecessary imports, conversions, and other common, easy-to-detect coding errors. You can quickly remove these errors by using a code cleanup technique. Right-click on your project folder to select Source>clean up. Like the Code formatting tool, you can customize your own code cleanup as well.

4. Turn to the declaration--Do you want to know where the method, variable, or class is declared? This is simple, hold down the CTRL key, and then click Reference.

5. Find All references -if you want to find all references for a method, variable, or class, select the desired reference, then right-click and select the desired search scope.

6. Quickly select a group of characters --need to delete the entire string, or a method parameter declaration of all things? Select the characters at both ends of the string (such as the "symbol" or the "sign" of the last sentence) so that everything in the middle is selected. This applies even to classes and methods. You can select an entire row with three clicks.

7. Rename all entities ———— if you need to rename a method, variable, or class, you can rename it by renaming any one of the entities, selecting the reference and pressing the ALT + Shift + key, and then the Reference dialog box appears. Press Enter and all the entities will be renamed.

8. Change the method signature ———— If you need to change any part of the method signature, a method name, parameter, or return type, you can quickly change all the parameters in the method by using the reference method. Press ALT + SHIFT + C key and a dialog will pop up for you to select.

9. Automatically generate getters and setters--fools write their own getters and setters. After you have written out all the members of the class, right-click anywhere in the Encoding window and select Creen>source>generate getters and setters. Select the variable you want to generate getters and setters for.

Javadoc document generation is simple -the document generation in eclipse is a simple matter, just type "/**" and press Enter on a declaration. Eclipse automatically creates contextual-related documentation comments (such as a method parameter or the author of a class). After that you only need to write out what this method actually should do.

11. Run the unit test --check the unit test, press ALT + SHIFT + X, and then press the T key. You can run unit tests inside the debugger by pressing ALT + SHIFT + D, and then pressing the T key.

12. Comment out the code --If you need to quickly comment out the code block, select the appropriate line and then press CTRL +/, you can use the same method to dismiss the code comment.

The meaning of various small icons of Eclipse

12 tips for efficient use of eclipse

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.