fix: run actions on EDT thread

no clue what that is but intellij seems to want it
This commit is contained in:
əlemi 2024-10-02 02:35:33 +02:00
parent d48954abfc
commit ecdba4ae01
Signed by: alemi
GPG key ID: A4895B84D311642C
9 changed files with 54 additions and 0 deletions

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationManager;
@ -101,4 +102,9 @@ public class BufferAttachAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -27,4 +28,9 @@ public class BufferCreateAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -27,4 +28,9 @@ public class BufferDeleteAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -46,4 +47,9 @@ public class BufferDetachAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationManager;
@ -76,4 +77,9 @@ public class BufferShareAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.buffer; package mp.code.intellij.actions.buffer;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.application.ApplicationManager;
@ -67,4 +68,9 @@ public class BufferSyncAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isInWorkspace()); e.getPresentation().setEnabled(CodeMP.isInWorkspace());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.workspace; package mp.code.intellij.actions.workspace;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -32,4 +33,9 @@ public class WorkspaceCreateAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isConnected()); e.getPresentation().setEnabled(CodeMP.isConnected());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.workspace; package mp.code.intellij.actions.workspace;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -36,4 +37,9 @@ public class WorkspaceDeleteAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isConnected()); e.getPresentation().setEnabled(CodeMP.isConnected());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }

View file

@ -1,5 +1,6 @@
package mp.code.intellij.actions.workspace; package mp.code.intellij.actions.workspace;
import com.intellij.openapi.actionSystem.ActionUpdateThread;
import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.Messages;
@ -52,4 +53,9 @@ public class WorkspaceInviteAction extends AnAction {
public void update(@NotNull AnActionEvent e) { public void update(@NotNull AnActionEvent e) {
e.getPresentation().setEnabled(CodeMP.isConnected()); e.getPresentation().setEnabled(CodeMP.isConnected());
} }
@Override
public @NotNull ActionUpdateThread getActionUpdateThread() {
return ActionUpdateThread.EDT;
}
} }