<editor-fold>
标签可以让我们查看代码结构时更加清晰
使用方法
public class TestClass {
//<editor-fold desc="一些常量">
private static final String TAG = TestClass.class.getSimpleName();
//</editor-fold>
//<editor-fold desc="一些变量">
private String type;
private boolean isShow;
//</editor-fold>
//<editor-fold desc="构造方法">
public TestClass(String type, boolean isShow) {
this.type = type;
this.isShow = isShow;
}
//</editor-fold>
//<editor-fold desc="单元测试">
@Test
public void name() {
}
//</editor-fold>
}
效果
打开代码结构窗口,可以通过点击IDE左边的Structure
打开,或者通过快捷键打开,macOS -> CMD
+ F12
, Windows -> Ctrl
+ F12

展开
