nomee.tec
nomee.tec

Reputation: 141

How to add new line in end of arguments eclipse [editor]

currently my codes i look like this and

holder a=new holder(a,s,c,v,b,n,q,w,e,r);

i want it to look like this

holder a=new holder(a,
                    s,
                    c,
                    v,
                    b,
                    n,
                    q,
                    w,
                    e,
                    r);

dose any one knew how can i do this with auto format ctrl+shift+f

Upvotes: 1

Views: 223

Answers (2)

Ratheesh Pai
Ratheesh Pai

Reputation: 1630

Eclipse 4.2

Code format --> Line Wrapping --> Function Calls --> Object Allocation Arguments

Choose "Wrap all elements, Every element in new line"

Upvotes: 1

BillToWin
BillToWin

Reputation: 126

All options regarding Eclipse's Automated Formatting can be found by going to Window -> Preferences then choosing Java -> Code Style -> Formatter. Click on the Edit... button and change the formatting options as you like.

Although I'm unsure whether the specific configurations of arguments you want is easy to configure. Clicking on the New Lines tab and looking at Array Initializers the configuration you want is unavailable.

It might be hidden somewhere else but I doubt it.

Upvotes: 1

Related Questions