Formatting array initializers with Eclipse

余生颓废 提交于 2019-12-23 08:15:46

问题


Is there any way I can instruct Eclipse's formatter to put each value in an array initializer on a new line?


回答1:


You can do it this way: windows/preferences/java/code style/formatter, then near the selected active profile click edit

then on the "Line Wrapping" tab

Choose "Expressions"->"Array initializers"

Under The list choose "Wrap all elements, every element an a new line"




回答2:


Go to windows/preferences/java/code style/formatter, then near the selected active profile click edit, then on the new lines tab there are 2 options for this.



来源:https://stackoverflow.com/questions/5552192/formatting-array-initializers-with-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!