The following describes some common convenient functions of eclipse through this article.
A. Code prompt
You can set the code prompt function by yourself. By default, the code prompt is displayed when you enter. In eclipse. When you press any letter, the Code prompts: eclipse-> window-> preferences-> JAVA-> Editor-> content assist-> auto-activation, we can see that:
Observe the fourth row: auto activation triggers for Java. Normally, the text box contains only ., that is, only the input is typed. the code prompt appears, and the text box can only be entered with a maximum of five characters. To input any letter, a code prompt is displayed. You can export preferences: eclipse-> export-> General-> preferences. For details, see:
, And then save it as a eclipse-preference.epf, and then open it with text software, find the following line:
"/Instance/org. Eclipse. jdt. UI/content_assist_autoactivation_triggers_java =", then assign a value to ". abcdefghijklmnopqrstuvwsyz" and save it. Then you can import the modified eclipse-preference.epf in a similar way.
// In fact, you can directly input abcdefghijklmnopqrstuvwsyz at the end of the. Script. Apply the command! (Xueshishasha)
PS: fixed the bug in the previous code prompt in eclipse3.4. In this version, all the code prompt letters can be entered in the text box after auto activation triggers for Java. In addition, you can use the shortcut key "Alt +/" to implement code prompts.
B. automatically generate comments (author, date, and other related information are automatically generated when a new class is created)
Windows --> preference-> JAVA --> code style --> code templates --> code --> New java files, and then edit the relevant information. For example:
$ {Filecomment}
$ {Package_declaration}
/**
* @ Author Landon E-mail: landonyongwen@126.com
* @ Version Creation Time: $ {date }$ {time}
* Class description
*/
$ {Typecomment}
$ {Type_declaration}
C. Format
Select the code and press the shortcut key Ctrl + Shift + f or right-click source-> Format (for setting the code template, see window-> preference-> JAVA-> code style) or select the top menu item source of eclipse, and then select the menu item format
D. automatically generate getter/setter: Right-click-> source-> Generate getters and setters or select the top menu item source in eclipse, and then select the menu item generate getters and setters.
E. Rename: Right-click refactor-> rename or select refactor from the top menu item of eclipse, and then select Rename from the first menu item.
In addition, the source function of eclipse mainly includes generating comments, generating getter/setter, generating constructor, generating hashcode, equals, and so on. The refactor function includes rename, move, and change method signature.
F. Common eclipse shortcut keys:
Through eclipse-> window-> preferences-> General-> keys, we can view all the shortcut keys here. Below we will introduce the commonly used shortcut keys:
A. CTRL + Shift +/Add block comment: Add block comments
B. Alt + Left backward history
C. Alt + Shift + J add javadoc comment: Add javadoc comments
D. Alt + Shift + c Change Method Signature: change the method Signature
E. Alt +/content assist: code prompt
F. CTRL + D Delete lien: delete a row
G. Alt + Shift + d debug: Debugging
H. CTRL + F find and replace: search and replace
I. Alt + right foward history
J. CTRL + Shift + F format
K. CTRL +/toggle comment: Switch Annotation
This article is excerpted from:
Http://www.blogjava.net/landon/archive/2010/07/15/326190.html