简体   繁体   English

如何以格式化程序样式 [eclipse] 保留具有特定排列的数组元素

[英]How can I keep array elements with specific arrangement in formatter style [eclipse]

I tried to find in formatter style preferences on eclipse to keep my array elements like that image:我试图在 eclipse 上找到格式化程序样式首选项,以保持我的数组元素像该图像一样:

在此处输入图像描述

Where can I find that style to modify it?我在哪里可以找到那个样式来修改它? 在此处输入图像描述

You can configure this in Line Wrapping > Wrapping settings > Other expressions > Array initializers .您可以在Line Wrapping > Wrapping settings > Other expressions > Array initializers中配置它。

By the way, ... = new String[] {... can be shorten here to ... = {... (Eclipse provides a clean-up for that: Unnecessary Code > Create array with curly when possible ).顺便说一下, ... = new String[] {...可以在这里缩短为... = {... (Eclipse 为此提供了清理: Unnecessary Code > Create array with curly when possible )。

As the following image shown:如下图所示: 在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM