使用Eclipse格式化数组初始化器 [英] Formatting array initializers with Eclipse

查看:280
本文介绍了使用Eclipse格式化数组初始化器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案

有没有什么办法可以指示Eclipse的格式化程序将每个值放在一个数组初始化器中?你可以这样做:
windows / preferences / java / code style / formatter,然后在选定的活动配置文件附近点击编辑



然后在Line包装选项卡



选择表达式 - >数组初始化程序



在列表下选择全部包装元素,每个元素都是新行


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

解决方案

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"

这篇关于使用Eclipse格式化数组初始化器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆