Following code is from a sample of playframework-2.0:
/**
* Display the dashboard.
*/
public static Result index() {
return ok(
dashboard.render(
Project.findInvolving(request().username()),
Task.findTodoInvolving(request().username()),
User.find.byId(request().username())
)
);
}
It looks good, but when I use code format of eclipse, it becomes:
/**
* Display the dashboard.
*/
public static Result index() {
return ok(dashboard.render(
Project.findInvolving(request().username()),
Task.findTodoInvolving(request().username()),
User.find.byId(request().username())
));
}
How to configure eclipse to keep to first format style? I tried a lot, but not works.
You have to using Code Formatter
in eclipse. You can find it in following path:
windows
menu and inPreferences
item.- go to
java
in left tree. - go to
code style
sub-tree ofjava
. - select
Formatter
leaf. - click
Edit
button and edit your customize formate and save it.
I recomend you save your customization environment such as formatter and use it in others place. Eclipse
hold formatter
information in a xml file. you can specify path of this file.
following link is useful:
来源:https://stackoverflow.com/questions/9989142/how-to-configure-eclipse-to-keep-this-code-format