Common eclipse shortcut settings, eclipse

Source: Internet
Author: User

Common eclipse shortcut settings, eclipse

1. Code prompt

When we forget the method name or want to be lazy, the code prompt is very useful. However, Eclipse inputs ". "Then the prompt of the package or class member will appear, which means that we must enter a complete class name before the prompt can come out; or press alt +/every time /. How can I make a prompt appear every time I enter a letter? Here you can set:
Window-> Preferences-> Java-> Editor-> Content Assist-> Auto Activation


Delay is the delay time in the pop-up prompt box, which can be modified to 100 milliseconds. The default value of triggers is ".", as long as "abcdefghijklmnopqrstuvwxyz" or "delay" is added"

2. Basic settings

Set the font type and size of the Code:
Window-> Preferences-> General-> Appearance-> Content Assist-> Colors and forets, you only need to modify the Text Font in Basic.



4. Set the encoding of text files and JSP files

Window-> Preferences-> General-> Workspace-> Text file encoding-> Other:

 
Window-> Preferences-> Web-> JSP Files-> Text file encoding-> Other:


5. Set the JDK local JavaDOC API path and source code path.

  

When you need code prompts, you may often encounter the following situations:

They also generate meaningless variable names, which may interfere with the call sequence of variable parameters of the same type;

This problem can be avoided by importing the source code of the JDK or corresponding Jar package:

Window-> Preferences-> Java-> Installed JREs-> Edit:

Select the set JRE directory, edit it, select all Jar packages under JRE system libraries, and click Source Attachment on the right;

Under External location, select the src.zip file under the JDK installation directory and click OK.

After the settings, let's take a look at the benefits of happiness!


6. Set Servlet Source Code or other Jar package source code

  

When we use a non-JDK, such as a Servlet package or class, this stuff comes out again, so we can't wait until we get started...

I have already set the JDK source code or JavaDoc path in the previous step. Why is it now? In fact, this is not hard to understand, because the source code of the class we use is not in the JDK source code package.

Take a closer look, we will find that these Jar packages are actually in the lib folder under the Tomcat root directory, but the Tomcat directory does not have the corresponding jar or zip files. If you do not have a local host, go to the official website to find it:

Http://tomcat.apache.org/download-70.cgi here there are Tomcat installation package and source code package;

 

You can customize a folder for storing JavaSource and JavaDoc and put the downloaded files in this directory,

Switch to Eclipse, select a class or function without code prompts, press F3, and click Change Attached Source:

Select the tomcat source code file we just downloaded, all the way OK.

Then let's look back at our code prompts. You are much better:

You can set the source code of other Jar packages in the same way.

7. Automatic prompts for HTML, JavaScript, and JSP file code

Second, we have mentioned the Code Automatic prompts in the Java file. If other types of files such as HTML, JavaScript, and JSP can also provide prompts, isn't it better? With the second setting, these settings are the same. Let's take a look at JavaScript:

Window-> Preferences-> JavaScript-> Editor-> Content Assist-> Auto-Activation

HTML:

Window-> Preferences-> Web-> HTML Files-> Editor-> Content Assist-> Auto-Activation

After saving it, Let's enter it again. It feels really good:

 

 

VIII. decompilation plug-in JD-Eclipse

Whether it is development or debugging, decompilation is essential. You can use jd-gui to open it every time. This is a lot of trouble. Simply configure the JD plug-in and automatically associate it with. class:

Download the offline installation package jdeclipse_update_site.zip from the http://jd.benow.ca, decompress the package, copy the two folders features and plugins to the new folder jdeclipse, and then copy the entire jdeclipse folder to the dropins folder under the Eclipse root directory, restart Eclipse. Is this method more convenient than link file creation?

Open Eclipse, Window-> Preferences-> General-> Editors, and close the. class file to the editor of the jd plug-in.

 

9. garbled Chinese characters in the properties File

Eclipse open the properties file, Chinese will show garbled characters, this is because the default encoding method of the properties file is iso8859-1, modify it to UTF-8, it can be properly displayed:

Window-> Preferences-> General-> Content Types-> Text-> Java Properties File-> UTF-8-> Update-> OK

 

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.