JSF代码格式化程序或Eclipse XML编辑器,新行的每个标记? [英] JSF Code formatter or Eclipse XML Editor, each tag for new line?

查看:212
本文介绍了JSF代码格式化程序或Eclipse XML编辑器,新行的每个标记?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在eclipse中格式化 JSF 代码?

How to format JSF code in eclipse?

我已尝试如下:

  • Format XML code in Eclipse

我的 XML编辑器配置设置为:


  • 线宽 120

  • 在新的上分割多个属性已检查

  • 对齐多行元素标记中的最后一个括号已检查

  • 清除所有空白行已检查

  • Line width 120
  • Split multiple attributes each on a new like Checked
  • Align final bracket in mulit-line element tags Checked
  • Clear all blank lines Checked

如果我执行 Ctrl + Shif + F ,eclipse格式化代码如下。

If I do Ctrl + Shif + F, eclipse format the code as below.

<tr>
    <td><h:outputText value="#{label['MANAGE_USER_TITLE']}"
            styleClass="table-title" /></td>

</tr>

我的期望格式是,在之后Ctrl + Shif + F

<tr>        
    <td>
        <h:outputText value="#{label['MANAGE_USER_TITLE']}" styleClass="table-title" /> 
                ▲
                This line may be wrap base on line size.
    </td>
</tr>

我该怎么做?有插件吗?
我已经尝试 HTML Tidy ,我只能格式化 HTML ,而不是 JSF 代码。

How can I do for that? Is there any plugin? I already try HTML Tidy, I can only format HTML, not JSF code.

更新

图片-1

图片-1的Eclipse设置

Eclipse Setting for Picture-1

图片 - 2(我想要)

Picture - 2 (I want)

推荐答案

查看Maheshbabu Jammula发布的设置面板,您可以看到内联元素列表。只需从列表中删除< tr> < td> 标记,这些标记将始终以新的标记着陆线。照顾自己!

Looking at the Settings panel that Maheshbabu Jammula posted, you can see an Inline Elements list. Just remove <tr> and <td> tags from the list and those tags will always land in a new line. Take Care!

首选项> Web> HTML文件>编辑器

Preferences > Web > HTML Files > Editor

这篇关于JSF代码格式化程序或Eclipse XML编辑器,新行的每个标记?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆