2.07 global-setting reset default | 全局设置 复位默认值 fixed #19
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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("");
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user