diff --git a/build.gradle b/build.gradle index f4b2e2f..939f042 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ plugins { } group 'com.liuzhihang' -version '1.0.1' +version '1.0.2' JavaVersion.VERSION_1_8 diff --git a/src/main/java/com/liuzhihang/doc/view/component/SettingsConfigurable.java b/src/main/java/com/liuzhihang/doc/view/component/SettingsConfigurable.java index 2976263..4542553 100644 --- a/src/main/java/com/liuzhihang/doc/view/component/SettingsConfigurable.java +++ b/src/main/java/com/liuzhihang/doc/view/component/SettingsConfigurable.java @@ -32,7 +32,7 @@ public String getDisplayName() { @Override public JComponent createComponent() { - return new SettingsForm().createCenterPanel(); + return new SettingsForm().getRootPanel(); } @Override diff --git a/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java b/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java index d337ba5..ddfac47 100644 --- a/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java +++ b/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java @@ -1,10 +1,13 @@ package com.liuzhihang.doc.view.ui; import com.intellij.icons.AllIcons; +import com.intellij.openapi.project.Project; +import com.intellij.openapi.project.ProjectManager; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.IdeBorderFactory; import com.intellij.ui.components.labels.LinkLabel; import com.intellij.util.ui.JBUI; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -13,7 +16,7 @@ * @author liuzhihang * @date 2020/2/26 19:17 */ -public class SettingsForm extends DialogWrapper { +public class SettingsForm { private JPanel rootPanel; private LinkLabel supportLinkLabel; @@ -21,7 +24,6 @@ public class SettingsForm extends DialogWrapper { public SettingsForm() { - super(null); supportLinkLabel.setBorder(JBUI.Borders.emptyTop(20)); @@ -34,14 +36,7 @@ public SettingsForm() { } - @Nullable - @Override - public JComponent createCenterPanel() { + public JPanel getRootPanel() { return rootPanel; } - - private void createUIComponents() { - // place custom component creation code here - - } } diff --git a/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java b/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java index e85f84d..187dbc8 100644 --- a/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java +++ b/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java @@ -23,7 +23,7 @@ public class SupportForm extends DialogWrapper { private LinkLabel websiteLinkLabel; public SupportForm() { - super(null); + super(null, true, DialogWrapper.IdeModalityType.PROJECT); init(); @@ -39,8 +39,8 @@ public SupportForm() { starLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://github.com/liuzhihang/doc-view"); reportLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://github.com/liuzhihang/doc-view/issues"); ideaLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://plugins.jetbrains.com/plugin/15305-doc-view"); - prLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://github.com/liuzhihang/doc-view/pulls"); - prLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://docview.liuzhihang.com"); + shareLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://github.com/liuzhihang/doc-view/pulls"); + websiteLinkLabel.setListener((source, data) -> BrowserUtil.browse(data), "https://docview.liuzhihang.com"); } @Nullable