2.07 global-setting reset default | 全局设置 复位默认值 fixed #19

This commit is contained in:
林万程
2022-12-11 22:09:44 +08:00
parent a37d7b86cc
commit 9c6c811eec
9 changed files with 45 additions and 4 deletions

View File

@@ -31,6 +31,11 @@ Show doc comment at the Project view Tree, line End, json etc.
<li>The tsv conf file must could be search in "Go to File"(Ctrl + Shift + N)
</ul>
<h2>My Other Project</h2>
<ul>
<li>Find author/comment of multiple files or lines and export Find:
<a href="https://plugins.jetbrains.com/plugin/20557-find-author">Find Author</a>
</ul>
<h2>中文说明:</h2>
<ul>
@@ -58,9 +63,17 @@ Show doc comment at the Project view Tree, line End, json etc.
<li>tsv 配置文件必须能被搜索(Ctrl + Shift + N)
</ul>
<h2>我的其他项目</h2>
<ul>
<li>查找多个文件或行的作者与导出搜索:
<a href="https://plugins.jetbrains.com/plugin/20557-find-author">Find Author</a>
</ul>
<hr>
如果对你有所帮助,别忘了给本项目
<a href="https://github.com/LinWanCen/show-comment">GitHub</a>
主页一个 Start,您的支持是项目前进的动力。
主页一个 Star您的支持是项目前进的动力。
@@ -68,6 +81,7 @@ Show doc comment at the Project view Tree, line End, json etc.
<h2>English Change Notes:</h2>
<ul>
<li>2.07 Add global-setting reset default
<li>2.06 Add project-view-tree xx-abc.xxx from Abc.java doc
<li>2.05 Add line-end-comment json doc from xxx.json.tsv
<li>2.04 Add line-end-comment json dict doc from (key).tsv
@@ -103,6 +117,7 @@ Show doc comment at the Project view Tree, line End, json etc.
<h2>中文更新说明:</h2>
<ul>
<li>2.07 增加 全局设置 复位默认值
<li>2.06 增加 文件树注释 xx-abc.xxx 来自 Abc.java 的文档注释
<li>2.05 增加 行末注释 json 字段注释从 xxx.json.tsv 读取
<li>2.04 增加 行末注释 json 字典注释从 键名.tsv 读取

View File

@@ -4,7 +4,7 @@ plugins {
}
group 'io.github.linwancen'
version '2.06.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
version '2.07.0.' + (new Date().format('yyyy.MM.dd_HH.mm'))
repositories {
mavenCentral()
@@ -87,6 +87,7 @@ patchPluginXml {
changeNotes = """
<h2>English Change Notes:</h2>
<ul>
<li>2.07 Add global-setting reset default
<li>2.06 Add project-view-tree xx-abc.xxx from Abc.java doc
<li>2.05 Add line-end-comment json doc from xxx.json.tsv
<li>2.04 Add line-end-comment json dict doc from (key).tsv
@@ -122,6 +123,7 @@ patchPluginXml {
<h2>中文更新说明:</h2>
<ul>
<li>2.07 增加 全局设置 复位默认值
<li>2.06 增加 文件树注释 xx-abc.xxx 来自 Abc.java 的文档注释
<li>2.05 增加 行末注释 json 字段注释从 xxx.json.tsv 读取
<li>2.04 增加 行末注释 json 字典注释从 键名.tsv 读取

View File

@@ -15,6 +15,7 @@ public class OwnerToPsiDocSkip {
private OwnerToPsiDocSkip() {}
@Nullable
public static <T extends SettingsInfo> PsiDocComment refDoc(@NotNull T settingsInfo,
@Nullable PsiDocCommentOwner docOwner) {
if (docOwner == null) {

View File

@@ -52,6 +52,7 @@ class SkipUtils {
return null;
}
@Nullable
static <T extends SettingsInfo> PsiDocComment skipDoc(@NotNull T settingsInfo, @Nullable PsiDocComment doc) {
if (doc == null) {
return null;

View File

@@ -36,7 +36,7 @@ public class DocFilter {
String[] split = LINE_SEPARATOR_PATTERN.split(text);
int lineCount = 0;
@NotNull StringBuilder sb = new StringBuilder();
for (String s : split) {
for (@NotNull String s : split) {
if (deletePrefix) {
s = DOC_PATTERN.matcher(s).replaceAll("");
}

View File

@@ -15,6 +15,7 @@ import java.awt.*;
public class AppSettingsComponent extends AbstractSettingsComponent {
private final JPanel myMainPanel;
private final JButton resetDefault = new JButton("Reset default ");
private final JBCheckBox showTreeComment = new JBCheckBox("Show tree comment ");
private final JBCheckBox compact = new JBCheckBox("compact ");
private final JBTextField treeTags = new JBTextField();
@@ -41,10 +42,12 @@ public class AppSettingsComponent extends AbstractSettingsComponent {
public AppSettingsComponent() {
myMainPanel = FormBuilder.createFormBuilder()
.addComponent(resetDefault, 1)
.addComponent(showPanel(), 1)
.addComponent(lineEndFilterPanel(), 1)
.addComponentFillVertically(new JPanel(), 0)
.getPanel();
resetDefault.addActionListener(e -> AppSettingsConfigurable.reset(AppSettingsState.DEFAULT_SETTING, this));
}
@NotNull

View File

@@ -109,6 +109,10 @@ public class AppSettingsConfigurable implements Configurable {
@Override
public void reset() {
@NotNull AppSettingsState settings = AppSettingsState.getInstance();
reset(settings, mySettingsComponent);
}
static void reset(@NotNull AppSettingsState settings, AppSettingsComponent mySettingsComponent) {
mySettingsComponent.setShowTreeComment(settings.showTreeComment);
mySettingsComponent.setCompact(settings.compact);

View File

@@ -21,6 +21,8 @@ import java.util.Locale;
)
public class AppSettingsState extends AbstractSettingsState implements PersistentStateComponent<AppSettingsState> {
public static final AppSettingsState DEFAULT_SETTING = new AppSettingsState();
public boolean showTreeComment = true;
public boolean compact = true;

View File

@@ -27,6 +27,11 @@ Show doc comment at the Project view Tree, line End, json etc.
<li>The tsv conf file must could be search in "Go to File"(Ctrl + Shift + N)
</ul>
<h2>My Other Project</h2>
<ul>
<li>Find author/comment of multiple files or lines and export Find:
<a href="https://plugins.jetbrains.com/plugin/20557-find-author">Find Author</a>
</ul>
<h2>中文说明:</h2>
<ul>
@@ -54,9 +59,17 @@ Show doc comment at the Project view Tree, line End, json etc.
<li>tsv 配置文件必须能被搜索(Ctrl + Shift + N)
</ul>
<h2>我的其他项目</h2>
<ul>
<li>查找多个文件或行的作者与导出搜索:
<a href="https://plugins.jetbrains.com/plugin/20557-find-author">Find Author</a>
</ul>
<hr>
如果对你有所帮助,别忘了给本项目
<a href="https://github.com/LinWanCen/show-comment">GitHub</a>
主页一个 Start,您的支持是项目前进的动力。
主页一个 Star您的支持是项目前进的动力。
]]></description>
<!-- please see https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html