diff --git a/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/action/MainAction.java b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/action/MainAction.java new file mode 100644 index 0000000000000000000000000000000000000000..dda8f6742e790ffbdd8cbbc96f29408394d17783 --- /dev/null +++ b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/action/MainAction.java @@ -0,0 +1,33 @@ +package com.duanledexianxianxian.plugin.idea.action; + +import com.intellij.database.psi.DbTable; +import com.intellij.openapi.actionSystem.AnAction; +import com.intellij.openapi.actionSystem.AnActionEvent; +import com.intellij.openapi.actionSystem.LangDataKeys; +import com.intellij.openapi.ui.Messages; +import com.intellij.psi.PsiElement; +import org.jetbrains.annotations.NotNull; + +/** + * 点击打开插件配置页面 + * + * @author duanledexianxianxian + * @date 2019/10/16 0:28 + * @since 1.0.0 + */ +public class MainAction extends AnAction { + @Override + public void actionPerformed(@NotNull AnActionEvent e) { + PsiElement[] psiElements = e.getData(LangDataKeys.PSI_ELEMENT_ARRAY); + if (psiElements == null || psiElements.length == 0) { + Messages.showMessageDialog("Please select one or more tables", "Notice", Messages.getInformationIcon()); + return; + } + for (PsiElement psiElement : psiElements) { + if (!(psiElement instanceof DbTable)) { + Messages.showMessageDialog("Please select one or more tables", "Notice", Messages.getInformationIcon()); + return; + } + } + } +} diff --git a/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.form b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.form new file mode 100644 index 0000000000000000000000000000000000000000..671b35fed317961604e60bc4f08fc2ca1aceb423 --- /dev/null +++ b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.form @@ -0,0 +1,31 @@ + +
diff --git a/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.java b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.java new file mode 100644 index 0000000000000000000000000000000000000000..85ceb23a66fd55cdc1a0aa0b92363d69bdcbcc0a --- /dev/null +++ b/plugin-gradle/src/main/java/com/duanledexianxianxian/plugin/idea/ui/MybatisConfigForum.java @@ -0,0 +1,12 @@ +package com.duanledexianxianxian.plugin.idea.ui; + +import javax.swing.*; + +/** + * @author duanledexianxianxian + * @date 2019/10/16 1:05 + * @since 1.0.0 + */ +public class MybatisConfigForum { + private JTextField textField1; +}