Yes you can do that. In the preference dialog, go to Java | Code Style | Formatter. (At this point I usually create my own Formatter based on the built-in one). Click the Edit button. The change things to your hearts content. You will probably want to make changes on both the New Lines and Line Wrapping tabs. And I suggest that after changing the formatting to what you want that you have the Formatter - then it will be easy to load your formatting preferences into an workspace, or to share with coworkers to ensure consist formatting in your project.
I already tried to play around with these settings, but it still does not preserve manual set linebreaks (inside function calls, method declarations etc.).
Eclipse only allows that it wraps itself automatically or that it removes the wrappings completely. Maybe you know the exact setting?
Under Line Wrapping, select Method Declarations | Parameters, and choose "wrap all elements, except first element if not necessary" and "indent on column"
manuel aldana
Ranch Hand
Joined: Dec 29, 2005
Posts: 308
posted
0
thanks for the screenshot!
the thing is that i don't want always to wrap the parameters. if a function has only 2 parameters, i don't need any automatic wrap lines. it should be more on the developer, who decides which looks better readable. as far as i can see the settings eclipse goes brute force and does not leave the developer the freedom to decide.
to me this is not so bad because i am using IntelliJ but some colleagues are using eclipse and the inconsistent automatic-formatting makes unneccessary changes to version control system.