Eclipse自动格式化变量初始化

时间:2014-07-18 13:59:44

标签: java eclipse format autoformatting

通常Eclipse会自动执行这样的初始化:

createLog = false;
experimentDuration = 1;
rampUpInterval = 1.0;
rampUpNumUsersPerInterval = 1;
coolDownInterval = 1;
coolDownNumUsersPerInterval = 1;
numUsers = 1;
thinkTimeMinimum = 1000;
thinkTimeMaximum = 1000;

我想有一个autoformat规则来格式化这样的初始化:

createLog                   = false;
experimentDuration          = 1;
rampUpInterval              = 1.0;
rampUpNumUsersPerInterval   = 1;
coolDownInterval            = 1;
coolDownNumUsersPerInterval = 1;
numUsers                    = 1;
thinkTimeMinimum            = 1000;
thinkTimeMaximum            = 1000;

有人知道我可以在哪里调整吗?

€dit:我想在构造函数中进行此对齐。

提前致谢!

1 个答案:

答案 0 :(得分:1)

转到Windows->Preferences->Java->Code Style->Formatter,编辑活动个人资料并查看Align fields in column选项

enter image description here