Resolves an issue where Eclipse and MyEclipse automatically format ugly when editing pages such as html,jsp

Source: Internet
Author: User

When you write Java code in Eclipse and Myelipse, it is time-saving and labor-efficient to use ctrl+shift+f shortcut keys, and the layout code is beautiful and hierarchical, but when we write JSP or HTML code, it is extremely ugly to use this shortcut to compose.

Such as

A row displays multiple labels at the same time, and the code automatically branches as long as it grows. This is very inconvenient in the course of our debugging, so what should we do? Does it have to be manually formatted yourself?

We have a two-point requirement:

1 is want to display only one label in a row

2 is the hope that the long dot code can not be branch

The workaround is to:

This is resolved in the MyEclipse:

Click on the Window tab of the MyEclipse menu bar to find the drop-down perferences option, and enter HTML in the shortcut "Search" box, as

In the number 3 where the line-width is set to how many characters are inside the current line, the line will be wrapped. This number is random, and here's an example of 100.

Next in the number 4 There (that is, inline Elements you want a row to display a LABEL element removed) removed, generally a, Li, label, input, SELECT,DL, Div, etc. these commonly used nesting the label of the other label.

Click OK after you finish, and then in the JSP or HTML page that you want to format, if you want to format the entire page Ctrl + A Select page and then press CTRL + SHIFT + Fto format the entire page. If you do not select all, by default CTRL + SHIFT + F is the entire page that is currently being edited.

If you want to format it locally, select the part you want to format with your mouse and press CTRL + SHIFT + F .

After you're done, this is the effect:

This is resolved in eclipse:

Click on the Window tab of the Eclipse menu bar to find the dropdown perferences option and enter the HTML in the Quick Search box.

In the number 3 where the line-width is set to how many characters are inside the current line, the line will be wrapped. This number is random, and here's an example of 100.

Next , in the number 4 (that is, inline Elements you want a row to display a LABEL element removed) removed, usually a, Li, label, input, Select,dl, div and so on these common tags that nest other labels.

Click OK after you finish, and then in the JSP or HTML page that you want to format, if you want to format the entire page Ctrl + A Select page and then press CTRL + SHIFT + F to format the entire page. If you do not select all, by default CTRL + SHIFT + F is the entire page that is currently being edited.

If you want to format it locally, select the part you want to format with your mouse and press CTRL + SHIFT + F.

After you're done, this is the effect:

Resolves an issue where Eclipse and MyEclipse automatically format ugly when editing pages such as html,jsp

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.