Java 使用 Eclipse 更好地对齐字段声明
在类中添加太多字段会变得一团糟,如下所示:
private static final int UNAVAILABLE = -1;
private static final int EXTERNAL_BUFFER_SIZE = 4000 * 4;
private static final int SKIP_INACCURACY_SIZE = 1200;
private Thread thread = null;
private Object dataSource;
private AudioInputStream audioInputStream;
private AudioInputStream encodedAudioInputStream;
private int encodedAudioLength = -1;
private AudioFileFormat audioFileFormat;
private SourceDataLine sourceDataLine;
我希望Eclipse重新格式化代码并使其更好地阅读,所以我修改了默认格式化程序并实现了这一点:
private static final int UNAVAILABLE = -1;
private static final int EXTERNAL_BUFFER_SIZE = 4000 * 4;
private static final int SKIP_INACCURACY_SIZE = 1200;
private Thread thread = null;
private Object dataSource;
private AudioInputStream audioInputStream;
private AudioInputStream encodedAudioInputStream;
private int encodedAudioLength = -1;
private AudioFileFormat audioFileFormat;
private SourceDataLine sourceDataLine;
但它仍然很混乱,我找不到如何进一步修改编辑器来实现这一点(你可以看到static
)
(在这里找到这段代码,我认为它可以进一步改进以创建和空列):final
Eclipse 中编辑器的图像:
我该怎么做?