Chained methods formatting in Eclipse

eclipse, formatter, java

Solution

You say:

...if the first method call already is placed...call should be untouched...

If you don't want the formatter to wrap already wrapped lines, have a look at this panel:

Problem

I'd like to configure the Eclipse java formatter to format chained method calls like that: ``` lblName .setX(last.getX() + last.getWidth()) .setY(0) .setHeight(this.height) .setWidth(80); ``` My problem is, that I don't know how to make it only format it like this, if the first method call already is placed in the second line. This call should be untouched: ``` lblName.setX(last.getX() + last.getWidth()).setY(0).setHeight(this.height).setWidth(80); ```

Original source

Related problems