This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
Under Line Wrapping, select Method Declarations | Parameters, and choose "wrap all elements, except first element if not necessary" and "indent on column"
Joined: Dec 29, 2005
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.