Zaw Than oo
Zaw Than oo

Reputation: 9935

JSF Code formatter or Eclipse XML Editor, each tag for new line?

How to format JSF code in eclipse?

I already try as the following :

My XML Editor Configuration Setting is :

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>

My expectation format is, after 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>

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

Update

Picture -1

enter image description here

Eclipse Setting for Picture-1

enter image description here

Picture - 2 (I want)

enter image description here

Upvotes: 8

Views: 3370

Answers (2)

Kuba
Kuba

Reputation: 2089

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!

Preferences > Web > HTML Files > Editor

enter image description here

Upvotes: 9

Maheshbabu Jammula
Maheshbabu Jammula

Reputation: 467

Ctrl + Shif + F, only formats code.For indent use ctrl+a and ctrl+i

enter image description here

Upvotes: 6

Related Questions