Enhance the code prompt function of Eclipse and MyEclipse (Graphic tutorial) V1.1

Source: Internet
Author: User

Update description:

1. fixed the problem of automatically completing unnecessary words during instantiation.

2. redraw with MyEclipse 6.5

In view of the high voice of criticism on the internet, I just want to explain my thoughts: such an enhanced code prompt will eventually be used to assist us in development and improve development efficiency, it is not intended to satisfy the lazy behavior of "Don't knock so much code. For beginners, you can get some class names that are easy to forget and easy to forget through prompts (for beginners, many things are only used less ), reduce the pain of repeatedly querying APIs. For experts, you don't need to say much. Everyone has their own shortcut keys, but they are still very popular. Here, the enhanced code prompt is to play such a role to speed up coding, improve development efficiency. Of course, it takes a little time for everyone to adapt to this code prompt and make good use of it. If you use it, you will naturally get twice the result with half the effort.

By default, the code prompt function of Eclipse and MyEclipse is much worse than that of Microsoft Visual Studio, mainly Eclipse. MyEclipse has many options which are disabled by default, you need to manually configure the configuration by the developer. If you are not clear about Eclipse, the code prompt function of MyEclipse is as powerful as that of Microsoft Visual Studio.

First, let's give a simple example to illustrate the problem. For example, by default, in Eclipse and MyEclipse code, make a foreach, switch, and so on, you can't get code prompts (do not believe it yourself), let alone others, but get very friendly code prompts in Microsoft Visual Studio. In fact, in Eclipse, the code prompt function in the MyEclipse code is usually clicked "." by default, and the code prompt is usually clicked.

Principle:The "Auto Activation triggers for java" option is the option that triggers the code prompt. "to". abcdefghijklmnopqrstuvwxyz (, "refers to 26 letters and ., (These symbols trigger the code prompt function. (Rest assured, as mentioned later)

Enhance the code prompt function of Eclipse and MyEclipse 6.5. How can I configure it? The following describes the procedure (note that MyEclipse 6.5 is used for explanation, and the principles of others are the same ):

1. Open MyEclipse 6.5, and then "window" → "Preferences"

2. Select "java", expand, "Editor", and select "Content Assist ".

3. Select "Content Assist" and then see the "Auto Activation triggers for java" option under "Auto-Activation" on the right. In fact, it refers to the "." symbol that triggers the code prompt.

4. The "Auto Activation triggers for java" option should be followed by an abc letter after "." To facilitate later search and modification. Then, "apply" and click "OK ".

5. Then, select "File"> "Export", select "Perferences" in the pop-up window, and 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 choose "open with Notepad ".

8. You can see a lot of information about configuring MyEclipse 6.5.

9. Press the "ctrl + F" shortcut key, enter ". abc", and click "find next ".

10. Find the configuration information of ". abc" as follows:

11. Change ". abc" to ". abcdefghijklmnopqrstuvwxyz (,". Save and disable "test. epf ".

12. return to the MyEclipse 6.5 page, select "File"> "Import", select "Perferences" in the pop-up window, click "Next", and select the modified "test. open the epf file and click Finish ". This step is similar to the preceding export step.

13. Finally, of course, the code is tested. Create a project and a class. Enter switch and foreach in the Code for testing. You will immediately find that there are prompts, and there will be a lot of related prompts no matter which letter you typed, It is smooth and convenient.

Summary:

The "Auto Activation triggers for java" option is the option that triggers the code prompt. "to". abcdefghijklmnopqrstuvwxyz (, "refers to 26 letters and ., (These symbols trigger the code prompt function.

Of course, ". abcdefghijklmnopqrstuvwxyz (," You can also add uppercase letters and other symbols here. You can set and adjust them as needed.

This Auto activation delay is used to set the delay time for triggering code prompts. 200 refers to 200 ms, which is the default value and can be set as needed.

By the way, you can modify the class name and interface name highlighted in different colors. You can configure it in "java"> "enditor"> "syntac ", expand "java"> "classes" on the right side, check the "Enable" option, and select your preferred color. Of course there are other related color configurations. Not to mention it. In fact, in Preferences,

In fact, there are many other things that can be configured to optimize MyEclipse. Specifically, You need to configure them according to your personal preferences. Thank you.

Solves the problem of automatically completing unnecessary words during instantiation.

Problem description:

For example, when writing String to S, there is no prompt to write to St, so I added uppercase letters. The problem is, for example, I wrote String SQL = ""; when sqlStr is written to SQL, you must press esc or else sqlString will be generated.

This problem is annoying. The solution is as follows:

In the end, I wrote the code and tested it myself.

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.