1. Prompt key configuration
Generally, by default, the code prompt function of Eclipse and MyEclipse is much worse than that of Microsoft Visual Studio. Mainly, many options of Eclipse and MyEclipse are turned off by default, and developers must configure them manually. If developers don't know it, they don't know Eclipse. The code prompt function of MyEclipse can be as powerful as the code prompt function of Microsoft Visual Studio.
Let me first give a simple example to illustrate the problem. For example, in Eclipse and MyEclipse codes, you cannot get code prompts by calling foreach, switch, etc. (If you don’t believe me, try it yourself), let alone other things. In Microsoft You get very friendly code prompts in Visual Studio. In fact, the code prompt function in Eclipse and MyEclipse codes generally clicks "." by default. Generally, code prompts will appear only after clicking ".". Principle: The option "Auto Activation triggers for java" refers to the option to trigger code prompts. Changing "." to ".abcdefghijklmnopqrstuvwxyz(," means that when 26 letters and . are encountered, (these symbols trigger The code prompt function is now available. Enhance the code prompt function of Eclipse and MyEclipse. How to configure it specifically?
Let’s start with the steps:
1. Open MyEclipse, then "window" → "Preferences"
2. Select "java", expand "Editor", and select "Content Assist".
3. Select "Content Assist" and then see the "Auto-Activation" on the right.
Activation triggers for java" option. In fact, it means that the trigger code prompt is the "." character
Number.
4. For the "Auto Activation triggers for java" option, add abc letters after "." to facilitate subsequent searches.
Find modifications. Then "apply" and click "OK".
5. Then, select any item "File" → "Export" and select "Perferences" in the pop-up window.
Click "Next".
6. Select the export file path, export it to the desktop, enter "test" as the file name, and click "Save".
7. Find the file "test.epf" you just saved on the desktop, right-click and select "Open with Notepad".
8. You can see a lot of information about configuring MyEclipse
9. Press the "ctrl + F" shortcut key, enter ".abc", and click "Find Next".
10. Find the configuration information of “.abc”.
11. Change ".abc" to ".abcdefghijklmnopqrstuvwxyz(,", save and close "test.epf".
12. Return to the MyEclipse interface, "File" → "Import", select "Perferences" in the pop-up window, click "Next", select the "test.epf" file that has just been modified, click "Open", click "Finish". This step is similar to the export step above.
13. The last step is of course code testing. Just create a new project and create a new class. Enter switch, foreach, etc. in the code for testing. You will immediately find that there are prompts, and no matter which letter you type, there will be many related prompts. It is very smooth and convenient.
Summary: The option "Auto Activation triggers for java" refers to the option to trigger code prompts. Changing "." to ".abcdefghijklmnopqrstuvwxyz(," means that when 26 letters and . are encountered, these symbols will trigger code prompts. Function. Finally: It is best to change the pop-up time of the automatic prompt to less than 100 milliseconds, otherwise you will be finished before the automatic prompt pops up.
2. How to use shortcut keys to type System.out.println() in MyEclipse:
If you are not prompted for a command name named sysout when printing Sy characters, you can customize the string and command name to be printed. Similar (key-value) can be customized in Windows->Preferences->Java->Editor->Templates->new.
3. Prompt shortcut key settings:
Open Window->Preference->Generate->Keys, a large dialog box will appear. The command name corresponding to "Alt+/" is: "Content Assist". Find the command and click to select it. At this time, the information automatically showing the command will appear in Binding and When at the bottom of the window. Delete the information in Binding, and then press Alt+/ on the keyboard. At this time, Binding will automatically display the Alt+/ shortcut key, and then select in the when window. Editing Java Source and finally click OK.
4. Prompt background:
window--preference--java--editor-completion proposals Background color recommendation 85, 90, 205
5. Configure different colors for keywords
Modify the class name, interface name, etc. and highlight them in different colors
1. Open MyEclipse, then "window" → "Preferences".
2. It can be configured like this in "java" → "enditor" → "syntax coloring".
3. Expand "java" → "classes" on the right, check the "Enable" option, and select the color you like. There are of course other related color configurations. In fact, in the "Preferences" thing, there are many things that can be configured to optimize MyEclipse. The specific configuration requires each person to configure it according to his or her personal preferences.
6. Adjust the display size of the code in Myeclipse
window->preferences->general->apperance->colors and fonts->basic->text->fonts and then click change to change it!
7.Set the background color of the MyEclipse editing window
Right-click in the editing window -> Preferences -> General plus sign -> Editors plus sign -> click on Text Editors -> select Backgroud color in the lower right window, click on the System Default button on the right, and click on the color on the right of Color box, select color OK
8. Modify the background color of code editing in Eclipse:
The default color of the code editing interface is white. For people who have used computer programming for a long time, white is very irritating to our eyes, so changing the background color of the workspace can make the eyes more comfortable. The setting method is as follows:
1. Open window / Preference and pop up the Preference panel
2. Expand the General tab, select the Editors option, and expand it.
3. Select Text Editors, and the TestEditors panel will appear on the right. There is such an option in the panel: Appearance color options; among them are the settings for the colors of various sections, one of which is backgroundcolor. Check off System Default, click 'color', the color selection panel will pop up, select your favorite color, and click OK.
Note: Background color recommended by eye experts: Hue 85, Saturation 123, Brightness 205. The documents are no longer dazzling with black text on a white background, but a very soft bean paste green. This color is configured by ophthalmologists. It can effectively relieve eye fatigue and protect the eyes after long-term use.
4. Return to Test Editors and click Apply. Expand Test Editors, there are other options, such as the color style of the error prompt, you can try changing it as needed.
9.Eclipse font size adjustment:
Window / Preferences / General / Appearance / ColorsAnd Fonts, select Java - Java Editor Text Font in the dialog box on the right, click the Edit button that appears, you can set the font size of the program displayed in the main form, and the setting is complete. Then click Apply in the lower right corner, and finally click OK.
10.Xml file font size adjustment:
window / preferences / General / appearance / colors and fonts / Basic / "Text font" and then click Edit to set the font size.
11. Font size adjustment for console output in Eclipse
window/preferences/General/appearance/colors and fonts/Debug/ConsoleFont, set it here.
Articles are uploaded by users and are for non-commercial browsing only. Posted by: Lomu, please indicate the source: https://www.daogebangong.com/en/articles/detail/Eclipse-chang-yong-she-zhi.html
评论列表(196条)
测试