diff --git a/src/main/java/jezzsantos/automate/plugin/application/interfaces/patterns/Attribute.java b/src/main/java/jezzsantos/automate/plugin/application/interfaces/patterns/Attribute.java index 016ea00..f1a38a6 100644 --- a/src/main/java/jezzsantos/automate/plugin/application/interfaces/patterns/Attribute.java +++ b/src/main/java/jezzsantos/automate/plugin/application/interfaces/patterns/Attribute.java @@ -83,7 +83,7 @@ public static boolean isValidDataType(@NotNull AutomateConstants.AttributeDataTy if (value == null) { return false; } - return NumberUtils.isNumber(value); + return NumberUtils.isCreatable(value); case DATETIME: if (value == null) { diff --git a/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/drafts/DraftsListToolbarAction.java b/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/drafts/DraftsListToolbarAction.java index cca2952..3932346 100644 --- a/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/drafts/DraftsListToolbarAction.java +++ b/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/drafts/DraftsListToolbarAction.java @@ -3,6 +3,7 @@ import com.intellij.ide.DataManager; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; +import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.ex.ComboBoxAction; import jezzsantos.automate.plugin.application.IAutomateApplication; @@ -55,11 +56,11 @@ public void update(@NotNull AnActionEvent e) { } @Override - protected @NotNull DefaultActionGroup createPopupActionGroup(JComponent component) { + protected @NotNull DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext dataContext) { final var actions = new DefaultActionGroup(); - var project = DataManager.getInstance().getDataContext(component).getData(CommonDataKeys.PROJECT); + var project = DataManager.getInstance().getDataContext(button).getData(CommonDataKeys.PROJECT); if (project != null) { var application = IAutomateApplication.getInstance(project); if (application.isCliInstalled()) { diff --git a/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/patterns/PatternsListToolbarAction.java b/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/patterns/PatternsListToolbarAction.java index 3bcb4e7..604046c 100644 --- a/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/patterns/PatternsListToolbarAction.java +++ b/src/main/java/jezzsantos/automate/plugin/infrastructure/ui/actions/patterns/PatternsListToolbarAction.java @@ -3,6 +3,7 @@ import com.intellij.ide.DataManager; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.CommonDataKeys; +import com.intellij.openapi.actionSystem.DataContext; import com.intellij.openapi.actionSystem.DefaultActionGroup; import com.intellij.openapi.actionSystem.ex.ComboBoxAction; import jezzsantos.automate.plugin.application.IAutomateApplication; @@ -58,11 +59,11 @@ public void update(@NotNull AnActionEvent e) { } @Override - protected @NotNull DefaultActionGroup createPopupActionGroup(JComponent component) { + protected @NotNull DefaultActionGroup createPopupActionGroup(@NotNull JComponent button, @NotNull DataContext dataContext) { final var actions = new DefaultActionGroup(); - var project = DataManager.getInstance().getDataContext(component).getData(CommonDataKeys.PROJECT); + var project = DataManager.getInstance().getDataContext(button).getData(CommonDataKeys.PROJECT); if (project != null) { var application = IAutomateApplication.getInstance(project); if (application.isCliInstalled()) {