java - How to set Eclipse code formatter to support fluent interfaces -


this question has answer here:

i've started working api uses "fluent interface". i'm struggling find how configure eclipse code formatter support properly.

what want this:

foo myfoo = new foo()                   .setthis()                   .setthat()                   .settheother()                   .setonemorething(); 

but can't hit on right settings: end this:

foo myfoo = new foo().setthis().setthat()                   .settheother().setonemorething(); 

which near readable.

has solved this?

sorry: turns out near-duplicate of this: how indent fluent interface pattern "correctly" eclipse?

here's answer worked me:

the place set on "line wrapping" tab of code formatting preferences page, in "qualified invocations" section of "function calls" section. settings wanted were:

line wrapping policy: wrap element, except first element if not necessary

indentation policy: indent on column

enter image description here


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -