当未选中表时,不允许点击运行按钮

This commit is contained in:
makejava 2021-08-13 10:15:55 +08:00
parent 1f7eb2ef60
commit 3f7aac3007
1 changed files with 6 additions and 0 deletions

View File

@ -86,6 +86,12 @@ public class RealtimeDebugComponent {
public void actionPerformed(@NotNull AnActionEvent e) {
runDebug();
}
@Override
public void update(@NotNull AnActionEvent e) {
String selectVal = (String) comboBox.getSelectedItem();
e.getPresentation().setEnabled(allTables != null && allTables.containsKey(selectVal));
}
});
ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("Template Debug", actionGroup, true);
this.mainPanel.add(actionToolbar.getComponent());