diff --git a/README.md b/README.md
index 925522f..cb75369 100644
--- a/README.md
+++ b/README.md
@@ -58,6 +58,7 @@ Thanks JetBrains Licenses for Open Source.
English Change Notes:
+- 1.23 Add project-view-tree-comment setting for show when compact middle packages
- 1.22 Add PopupMenu Copy ClassName.MethodName
- 1.21 Add line-end-comment default skip only English when system lang is not `en`
- 1.20 Add get doc first sentence checkbox
@@ -84,6 +85,7 @@ Thanks JetBrains Licenses for Open Source.
中文更新说明:
+- 1.23 增加 项目导航栏注释 折叠中间包时显示中间包注释设置
- 1.22 增加 右键菜单 复制 类名.方法名
- 1.21 增加 行末注释 系统语言非英文时 默认 忽略纯英文
- 1.20 增加 获取第一句注释选项
diff --git a/build.gradle b/build.gradle
index 8e9677e..c6f994c 100644
--- a/build.gradle
+++ b/build.gradle
@@ -4,7 +4,7 @@ plugins {
}
group 'io.github.linwancen'
-version '1.22.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
+version '1.23.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
apply plugin: 'java'
@@ -39,6 +39,7 @@ patchPluginXml {
changeNotes = """
English Change Notes:
+- 1.23 Add project-view-tree-comment setting for show when compact middle packages
- 1.22 Add PopupMenu Copy ClassName.MethodName
- 1.21 Add line-end-comment default skip only English when system lang is not `en`
- 1.20 Add get doc first sentence checkbox
@@ -65,6 +66,7 @@ patchPluginXml {
中文更新说明:
+- 1.23 增加 项目导航栏注释 折叠中间包时显示中间包注释设置
- 1.22 增加 右键菜单 复制 类名.方法名
- 1.21 增加 行末注释 系统语言非英文时 默认 忽略纯英文
- 1.20 增加 获取第一句注释选项
diff --git a/src/main/java/io/github/linwancen/plugin/show/Tree.java b/src/main/java/io/github/linwancen/plugin/show/Tree.java
index 0a718f0..33f343b 100644
--- a/src/main/java/io/github/linwancen/plugin/show/Tree.java
+++ b/src/main/java/io/github/linwancen/plugin/show/Tree.java
@@ -131,6 +131,10 @@ public class Tree implements ProjectViewNodeDecorator {
if (docComment != null) {
return docComment;
}
+ AppSettingsState instance = AppSettingsState.getInstance();
+ if (!instance.compact) {
+ return null;
+ }
PsiDirectory parent = child.getParent();
if (parent == null) {
return null;
diff --git a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsComponent.java b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsComponent.java
index 2c4c2f7..f86bc90 100644
--- a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsComponent.java
+++ b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsComponent.java
@@ -15,6 +15,7 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
private final JPanel myMainPanel;
private final JBCheckBox showTreeComment = new JBCheckBox("Show tree comment ");
+ private final JBCheckBox compact = new JBCheckBox("compact ");
private final JBTextField treeTags = new JBTextField();
private final JBCheckBox showLineEndComment = new JBCheckBox("Show line end comment ");
private final JBTextField lineTags = new JBTextField();
@@ -59,7 +60,7 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
new JBLabel("json text color: "), lineEndJsonColor,
new JBLabel("prefix: "), lineEndPrefix);
FormBuilder formBuilder = FormBuilder.createFormBuilder()
- .addComponent(JPanelFactory.of(findElementRightToLeft))
+ .addComponent(JPanelFactory.of(findElementRightToLeft, compact))
.addSeparator()
.addComponent(JPanelFactory.of(fromCall, fromNew, fromRef, inJson, skipAnnotation, skipAscii, skipBlank), 1)
.addSeparator()
@@ -85,6 +86,14 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
showTreeComment.setSelected(newStatus);
}
+ public boolean getCompact() {
+ return compact.isSelected();
+ }
+
+ public void setCompact(boolean newStatus) {
+ compact.setSelected(newStatus);
+ }
+
@NotNull
public String getTreeTags() {
return treeTags.getText();
diff --git a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsConfigurable.java b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsConfigurable.java
index 8a905ef..070245b 100644
--- a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsConfigurable.java
+++ b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsConfigurable.java
@@ -33,6 +33,7 @@ public class AppSettingsConfigurable implements Configurable {
public boolean isModified() {
AppSettingsState settings = AppSettingsState.getInstance();
boolean modified = mySettingsComponent.getShowTreeComment() != settings.showTreeComment;
+ modified |= mySettingsComponent.getCompact() != settings.compact;
modified |= !mySettingsComponent.getTreeTags().equals(String.join("|", settings.treeTags));
modified |= mySettingsComponent.getShowLineEndComment() != settings.showLineEndComment;
modified |= !mySettingsComponent.getLineTags().equals(String.join("|", settings.lineTags));
@@ -61,6 +62,7 @@ public class AppSettingsConfigurable implements Configurable {
public void apply() {
AppSettingsState settings = AppSettingsState.getInstance();
settings.showTreeComment = mySettingsComponent.getShowTreeComment();
+ settings.compact = mySettingsComponent.getCompact();
settings.treeTags = Splitter.on('|').splitToList(mySettingsComponent.getTreeTags()).toArray(new String[0]);
settings.showLineEndComment = mySettingsComponent.getShowLineEndComment();
settings.lineTags = Splitter.on('|').splitToList(mySettingsComponent.getLineTags()).toArray(new String[0]);
@@ -91,6 +93,7 @@ public class AppSettingsConfigurable implements Configurable {
public void reset() {
AppSettingsState settings = AppSettingsState.getInstance();
mySettingsComponent.setShowTreeComment(settings.showTreeComment);
+ mySettingsComponent.setCompact(settings.compact);
mySettingsComponent.setTreeTags(String.join("|", settings.treeTags));
mySettingsComponent.setShowLineEndComment(settings.showLineEndComment);
mySettingsComponent.setLineTags(String.join("|", settings.lineTags));
diff --git a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsState.java b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsState.java
index 9a8bd6d..02e8d97 100644
--- a/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsState.java
+++ b/src/main/java/io/github/linwancen/plugin/show/settings/AppSettingsState.java
@@ -22,9 +22,10 @@ import java.util.Locale;
public class AppSettingsState extends AbstractSettingsState implements PersistentStateComponent {
public boolean showTreeComment = true;
+ public boolean compact = true;
public String[] treeTags = {"author"};
public boolean showLineEndComment = true;
- public String[] lineTags = {"author"};
+ public String[] lineTags = {};
public final TextAttributes lineEndTextAttr = new TextAttributes(
new JBColor(new Color(98, 151, 85), new Color(98, 151, 85)),