Set the code prompt function in MyEclipse and set the code in myeclipse.

Source: Internet
Author: User

Set the code prompt function in MyEclipse and set the code in myeclipse.

Why can I prompt you when writing code? Do you know that there are manual and automatic prompts? Today, we will take MyEclipse as an example to talk about how to set manual prompts and automatic prompts for MyEclipse.

Before starting this blog, let's talk about the manual and automatic prompts of the Code. You must press a shortcut key to display the prompt content. If you press the code, the prompt content appears automatically. Well, with such a premise, we will start to talk about it.

Manual prompt:

MyEclipse comes with the manual code prompt function, and its default key is Alt +/. However, sometimes the shortcut keys cannot be used due to the conflict of MyEclipse shortcut keys. So you can change the shortcut key. There are a lot of such articles on the Internet. Open MyEclipse, Window-Preferences, enter keys in the search box on the left, select and enter Alt +/in the search box on the right, select Content Assist, and change the shortcut key in the lower right to the appropriate one. As shown in. Okay, I will not talk about manual prompts much. Next I will focus on the function of automatically prompting code in MyEclipse.

Automatic prompt:

Before looking at OA, I thought there was only one way to set the automatic prompt. But after reading OA, I found that my understanding was biased. So I sorted it out and explained it separately below.

First, the Java class code is automatically prompted to set:

Open MyEclipse, Window-Preferences, and select Java-Editor-Content Assist on the left, as shown in, and ". "so the code will be automatically prompted only when you click the code. Here is what we want to change. Change it to ". abc ". After modification, click OK and exit.

In MyEclipse, File-Export

The following page is displayed:

Select General-Preferences and click Next.

Select an output path. My output path is desktop and named aaa. eof. Find the file in the corresponding path and open it. Ctrl + f search for ". abc"

Change ". abc" to ". abcdefghijklmnopqrstuvwxyz (,"

Save and close the file. Click File -- Import in MyEclipse again

The following page is displayed:

Click Next to continue the Next step.

Click Finish. In this way, the function of setting the MyEclipse automatic prompt code is complete. However, it should be noted that this is what I learned after reading the OA, and there is no detailed description on the Internet. The function of adding the MyEclipse automatic prompt code isJava class.

Now, let's talk about how to add the automatic code prompt function in the configuration file, which is also learned by OA. To introduce this, we should first extend some other content. Let's take a look at the following code. I will mark the content with a red line.

I don't know if you are familiar with the section marked with red lines. This is a description of the constraint file. The Struts2 configuration file does not automatically prompt information, that is, it cannot find this constraint file, as long as it obtains this constraint file, you will know where to write or not. All we need to do is add a constraint file to it.

First, use Window-Preferences in MyEclipse, enter xml in the search box on the left, and select XML Catalog.

Click Add to display the following page:

Click the File System button to go to your local location and find the struts-2.1.7.dtd in the Struts2 File

Change the Key type to URI, and set the constraint File Header token that we need to find in the Struts2 configuration file.

**************************************** ************************ ********************************

Now, this blog is here. A lot of knowledge is accumulated constantly, and the accumulation can be changed from quantitative change to qualitative change. This process is still very long. Let's accumulate it slowly .............

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: 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.