环境是 IntelliJ IDEA 12。
我已经Wrapping and Braces > Assignment Statement > Align when multiline
打勾了。当我有相邻的属性时,它们会正确对齐:
private final CustomerFactory customerFactory = FactoryBuilder.getDefaultCustomerFactory ( );
private final RepFactory repFactory = FactoryBuilder.getDefaultRepFactory ( );
private final WarehouseFactory warehouseFactory = FactoryBuilder.getDefaultWarehouseFactory ( );
但是当我有相邻的变量赋值时,它们不是:
final Integer account30 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_1 ) );
final Integer account60 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_2 ) );
final Integer account90 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_3 ) );
final Integer account120 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_4 ) );
final Integer priceNumber = parseInteger ( fields.get ( FIELD_PRICE_NUMBER ), 1 );
这是次要的,但它让我很烦。谁能告诉我我能做些什么来使这些相邻的变量声明对齐?我想要的是:
final Integer account30 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_1 ) );
final Integer account60 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_2 ) );
final Integer account90 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_3 ) );
final Integer account120 = parseCurrency ( fields.get ( FIELD_OVERDUE_BALANCE_4 ) );
final Integer priceNumber = parseInteger ( fields.get ( FIELD_PRICE_NUMBER ), 1 );