Commit 5d66c57c authored by duanledexianxianxian's avatar duanledexianxianxian 😁

sync

parent 497a62e8
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;
}
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.duanledexianxianxian.plugin.idea.ui.MybatisConfigForum">
<grid id="27dc6" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="b96c4" class="javax.swing.JTextField" binding="textField1" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<hspacer id="f7a5d">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<vspacer id="529eb">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</form>
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;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment