diff --git a/src/main/kotlin/org/zowe/explorer/dataops/content/synchronizer/SyncAction.kt b/src/main/kotlin/org/zowe/explorer/dataops/content/synchronizer/SyncAction.kt index 8359e8a35..1383da6e6 100644 --- a/src/main/kotlin/org/zowe/explorer/dataops/content/synchronizer/SyncAction.kt +++ b/src/main/kotlin/org/zowe/explorer/dataops/content/synchronizer/SyncAction.kt @@ -10,9 +10,9 @@ package org.zowe.explorer.dataops.content.synchronizer +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys -import com.intellij.openapi.actionSystem.ex.ActionUtil import com.intellij.openapi.components.service import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.progress.runBackgroundableTask @@ -20,10 +20,18 @@ import com.intellij.openapi.project.DumbAwareAction import com.intellij.openapi.vfs.VirtualFile import org.zowe.explorer.config.ConfigService import org.zowe.explorer.dataops.DataOpsManager -import org.zowe.explorer.utils.* +import org.zowe.explorer.utils.castOrNull +import org.zowe.explorer.utils.checkEncodingCompatibility +import org.zowe.explorer.utils.runReadActionInEdtAndWait +import org.zowe.explorer.utils.runWriteActionInEdtAndWait +import org.zowe.explorer.utils.showSaveAnywayDialog /** Sync action event. It will handle the manual sync button action when it is clicked */ class SyncAction : DumbAwareAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Get a virtual file on which the event was triggered * @param e the event to get the virtual file diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddConnectionAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddConnectionAction.kt index 71737d3ce..e42bd0d51 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddConnectionAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddConnectionAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.ui.SimpleToolWindowPanel @@ -33,6 +34,10 @@ import javax.swing.event.HyperlinkEvent */ class AddConnectionAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Shows connection dialog */ override fun actionPerformed(e: AnActionEvent) { val state = ConnectionDialog.showAndTestConnection( diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddJobsFilterAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddJobsFilterAction.kt index 4e1caf78c..8bcefd517 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddJobsFilterAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddJobsFilterAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.config.connect.CredentialService @@ -24,6 +25,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets */ class AddJobsFilterAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Opens AddJobsFilterDialog and saves result. */ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMaskAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMaskAction.kt index 6226d9a47..f3a3bc535 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMaskAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMaskAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.config.ws.DSMask @@ -26,6 +27,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets /** Action to add USS or z/OS mask */ class AddMaskAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Add new mask to the working set, where the action is triggered */ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMemberAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMemberAction.kt index 7bbcda246..72b7b9874 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMemberAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddMemberAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -38,6 +39,10 @@ import org.zowe.explorer.vfs.MFVirtualFile /** Class that represents "Add member" action */ class AddMemberAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Create a new member in the dataset library * @param e an action event to get the file explorer view and the project diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddWsActionBase.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddWsActionBase.kt index 859752a37..b0aa5deee 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AddWsActionBase.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AddWsActionBase.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DataContext @@ -27,6 +28,9 @@ import org.zowe.explorer.utils.crudable.Crudable */ abstract class AddWsActionBase : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } /** Shows add Working Set dialog (for files or for jobs) */ override fun actionPerformed(e: AnActionEvent) { diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/AllocateActionBase.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/AllocateActionBase.kt index 047f773ec..da060529d 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/AllocateActionBase.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/AllocateActionBase.kt @@ -14,6 +14,7 @@ import com.intellij.notification.Notification import com.intellij.notification.NotificationAction import com.intellij.notification.NotificationType import com.intellij.notification.Notifications +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -46,6 +47,10 @@ const val ALLOCATE_ACTION_NOTIFICATION_GROUP_ID = "org.zowe.explorer.explorer.Al abstract class AllocateActionBase : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Returns null if object doesn't contain anything * needed for allocation algorithm diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/CancelJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/CancelJobAction.kt index 83290ebda..b0a8280a4 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/CancelJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/CancelJobAction.kt @@ -11,6 +11,7 @@ package org.zowe.explorer.explorer.actions import com.intellij.notification.NotificationType +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -24,6 +25,10 @@ import org.zowe.kotlinsdk.Job /** Action to cancel a running job in the Jobs Tool Window */ class CancelJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun isDumbAware(): Boolean { return true } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/CreateUssEntityAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/CreateUssEntityAction.kt index 593c7838b..8590d7bd9 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/CreateUssEntityAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/CreateUssEntityAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -27,7 +28,14 @@ import org.zowe.explorer.dataops.operations.UssAllocationOperation import org.zowe.explorer.dataops.operations.UssAllocationParams import org.zowe.explorer.dataops.operations.UssChangeModeOperation import org.zowe.explorer.dataops.operations.UssChangeModeParams -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.CreateFileDialog +import org.zowe.explorer.explorer.ui.CreateFileDialogState +import org.zowe.explorer.explorer.ui.ExplorerUnitTreeNodeBase +import org.zowe.explorer.explorer.ui.FileExplorerView +import org.zowe.explorer.explorer.ui.UssDirNode +import org.zowe.explorer.explorer.ui.UssFileNode +import org.zowe.explorer.explorer.ui.getExplorerView +import org.zowe.explorer.explorer.ui.toAllocationParams import org.zowe.explorer.utils.castOrNull import org.zowe.explorer.vfs.MFVirtualFile import org.zowe.kotlinsdk.ChangeMode @@ -38,6 +46,10 @@ import org.zowe.kotlinsdk.FileType */ abstract class CreateUssEntityAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Uss file state which contains parameters for creating. */ diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/DeleteJesNodeAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/DeleteJesNodeAction.kt index 761d3fee6..e14869d6a 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/DeleteJesNodeAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/DeleteJesNodeAction.kt @@ -11,6 +11,7 @@ package org.zowe.explorer.explorer.actions import com.intellij.icons.AllIcons +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.ui.showYesNoDialog @@ -25,6 +26,10 @@ import org.zowe.explorer.explorer.ui.getExplorerView */ class DeleteJesNodeAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Called when delete JES element option is chosen from context menu */ @@ -83,6 +88,6 @@ class DeleteJesNodeAction : AnAction() { } val selected = view.mySelectedNodesData e.presentation.isEnabledAndVisible = selected.isNotEmpty() - && (selected[0].node is JesWsNode || selected[0].node is JesFilterNode) + && (selected[0].node is JesWsNode || selected[0].node is JesFilterNode) } } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/DuplicateMemberAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/DuplicateMemberAction.kt index a4291d10b..af01057d5 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/DuplicateMemberAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/DuplicateMemberAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -19,13 +20,24 @@ import org.zowe.explorer.config.connect.ConnectionConfig import org.zowe.explorer.dataops.DataOpsManager import org.zowe.explorer.dataops.attributes.RemoteMemberAttributes import org.zowe.explorer.dataops.operations.RenameOperation -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.ExplorerTreeView +import org.zowe.explorer.explorer.ui.FetchNode +import org.zowe.explorer.explorer.ui.FileExplorerView +import org.zowe.explorer.explorer.ui.FileLikeDatasetNode +import org.zowe.explorer.explorer.ui.NodeData +import org.zowe.explorer.explorer.ui.RenameDialog +import org.zowe.explorer.explorer.ui.cleanCacheIfPossible +import org.zowe.explorer.explorer.ui.getExplorerView /** * Class which represents a duplicate member action */ class DuplicateMemberAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * The method of AnAction abstract class. Tells what to do if an action was submitted */ @@ -50,7 +62,12 @@ class DuplicateMemberAction : AnAction() { * @throws any throwable during the processing of the request * @return Void */ - private fun runDuplicateOperation(project : Project, view : ExplorerTreeView, selectedNode : NodeData, newName: String) { + private fun runDuplicateOperation( + project: Project, + view: ExplorerTreeView, + selectedNode: NodeData, + newName: String + ) { val dataOpsManager = view.explorer.componentManager.getService(DataOpsManager::class.java) val attributes = selectedNode.attributes ?: return val file = selectedNode.file ?: return @@ -98,7 +115,8 @@ class DuplicateMemberAction : AnAction() { val selected = view.mySelectedNodesData val node = selected.getOrNull(0)?.node val nodeAttributes = selected.getOrNull(0)?.attributes - e.presentation.isVisible = selected.size == 1 && node is FileLikeDatasetNode && nodeAttributes is RemoteMemberAttributes + e.presentation.isVisible = + selected.size == 1 && node is FileLikeDatasetNode && nodeAttributes is RemoteMemberAttributes } } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditFilesWorkingSetAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditFilesWorkingSetAction.kt index a311d23c9..a2ba3598c 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditFilesWorkingSetAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditFilesWorkingSetAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DataContext @@ -31,6 +32,10 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey */ class EditFilesWorkingSetAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Called when edit working set option is chosen from context menu * Opens the working set table with elements to edit @@ -53,6 +58,7 @@ class EditFilesWorkingSetAction : AnAction() { } } } + else -> { return } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJclAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJclAction.kt index 1b68231f5..98fe2c52b 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJclAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJclAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -32,6 +33,10 @@ import org.zowe.explorer.vfs.MFVirtualFile */ class EditJclAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun isDumbAware(): Boolean { return true } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJesWorkingSetAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJesWorkingSetAction.kt index 58cd9e32d..00f57c667 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJesWorkingSetAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJesWorkingSetAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DataContext @@ -29,7 +30,11 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey /** * Action class for edit JES working set act */ -class EditJesWorkingSetAction: AnAction() { +class EditJesWorkingSetAction : AnAction() { + + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } /** * Called when edit JES working set option is chosen from context menu, diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJobsFilterAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJobsFilterAction.kt index 8af0c816f..cbb9f379e 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJobsFilterAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditJobsFilterAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.config.configCrudable @@ -29,6 +30,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets /** Action to edit job filter in JES working set tree view */ class EditJobsFilterAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Save changes when the dialog is fulfilled */ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditMaskAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditMaskAction.kt index 532b08557..e511c0a5c 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/EditMaskAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/EditMaskAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.config.configCrudable @@ -34,6 +35,10 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey */ class EditMaskAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Edit changed dataset mask. Will remove the mask from dataset masks list and add it to USS paths list * if the mask type changed diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/ForceRenameAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/ForceRenameAction.kt index e523ec184..77c66161b 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/ForceRenameAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/ForceRenameAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -23,7 +24,14 @@ import org.zowe.explorer.dataops.attributes.RemoteUssAttributes import org.zowe.explorer.dataops.operations.ForceRenameOperation import org.zowe.explorer.dataops.operations.RenameOperation import org.zowe.explorer.explorer.Explorer -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.ExplorerTreeNode +import org.zowe.explorer.explorer.ui.FileExplorerView +import org.zowe.explorer.explorer.ui.NodeData +import org.zowe.explorer.explorer.ui.RenameDialog +import org.zowe.explorer.explorer.ui.UssDirNode +import org.zowe.explorer.explorer.ui.UssFileNode +import org.zowe.explorer.explorer.ui.cleanCacheIfPossible +import org.zowe.explorer.explorer.ui.getExplorerView import org.zowe.explorer.vfs.MFVirtualFile /** @@ -31,6 +39,10 @@ import org.zowe.explorer.vfs.MFVirtualFile */ class ForceRenameAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Called when force rename is chosen from context menu */ diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/GetFilePropertiesAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/GetFilePropertiesAction.kt index 6514b81a6..f7371b50b 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/GetFilePropertiesAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/GetFilePropertiesAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.progress.runBackgroundableTask @@ -21,8 +22,24 @@ import org.zowe.explorer.dataops.attributes.RemoteUssAttributes import org.zowe.explorer.dataops.operations.UssChangeModeOperation import org.zowe.explorer.dataops.operations.UssChangeModeParams import org.zowe.explorer.explorer.ExplorerUnit -import org.zowe.explorer.explorer.ui.* -import org.zowe.explorer.utils.* +import org.zowe.explorer.explorer.ui.DatasetPropertiesDialog +import org.zowe.explorer.explorer.ui.DatasetState +import org.zowe.explorer.explorer.ui.ExplorerUnitTreeNodeBase +import org.zowe.explorer.explorer.ui.FileExplorerView +import org.zowe.explorer.explorer.ui.FileLikeDatasetNode +import org.zowe.explorer.explorer.ui.LibraryNode +import org.zowe.explorer.explorer.ui.MemberPropertiesDialog +import org.zowe.explorer.explorer.ui.MemberState +import org.zowe.explorer.explorer.ui.UssDirNode +import org.zowe.explorer.explorer.ui.UssFileNode +import org.zowe.explorer.explorer.ui.UssFilePropertiesDialog +import org.zowe.explorer.explorer.ui.UssFileState +import org.zowe.explorer.explorer.ui.cleanCacheIfPossible +import org.zowe.explorer.explorer.ui.getExplorerView +import org.zowe.explorer.utils.changeFileEncodingAction +import org.zowe.explorer.utils.clone +import org.zowe.explorer.utils.isBeingEditingNow +import org.zowe.explorer.utils.service import org.zowe.kotlinsdk.ChangeMode /** @@ -31,6 +48,10 @@ import org.zowe.kotlinsdk.ChangeMode */ class GetFilePropertiesAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Shows dialog with properties depending on type of the file selected by user. */ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return @@ -73,7 +94,7 @@ class GetFilePropertiesAction : AnAction() { progressIndicator = it ) }.onFailure { t -> - view.explorer.reportThrowable(t, e.project) + view.explorer.reportThrowable(t, e.project) } node.parent?.cleanCacheIfPossible(cleanBatchedQuery = false) } @@ -115,7 +136,7 @@ class GetFilePropertiesAction : AnAction() { val selected = view.mySelectedNodesData val node = selected.getOrNull(0)?.node e.presentation.isVisible = selected.size == 1 - && (node is UssFileNode || node is FileLikeDatasetNode || node is LibraryNode || node is UssDirNode) + && (node is UssFileNode || node is FileLikeDatasetNode || node is LibraryNode || node is UssDirNode) // Mark the migrated dataset properties unavailable for clicking if (node != null && (node is FileLikeDatasetNode || node is LibraryNode)) { diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/GetJobPropertiesAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/GetJobPropertiesAction.kt index 1c8aa64e9..325388a68 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/GetJobPropertiesAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/GetJobPropertiesAction.kt @@ -10,18 +10,31 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.config.connect.ConnectionConfig import org.zowe.explorer.dataops.DataOpsManager import org.zowe.explorer.dataops.attributes.RemoteJobAttributes import org.zowe.explorer.dataops.attributes.RemoteSpoolFileAttributes -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.ExplorerTreeNode +import org.zowe.explorer.explorer.ui.JesExplorerView +import org.zowe.explorer.explorer.ui.JobNode +import org.zowe.explorer.explorer.ui.JobPropertiesDialog +import org.zowe.explorer.explorer.ui.JobState +import org.zowe.explorer.explorer.ui.SpoolFileNode +import org.zowe.explorer.explorer.ui.SpoolFilePropertiesDialog +import org.zowe.explorer.explorer.ui.SpoolFileState +import org.zowe.explorer.explorer.ui.getExplorerView import org.zowe.explorer.utils.service /** Action to get job or spool file properties*/ class GetJobPropertiesAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Create properties dialog depending on received attributes*/ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return @@ -35,6 +48,7 @@ class GetJobPropertiesAction : AnAction() { val dialog = JobPropertiesDialog.create(e.project, JobState(attributes)) dialog.showAndGet() } + is RemoteSpoolFileAttributes -> { val dialog = SpoolFilePropertiesDialog.create(e.project, SpoolFileState(attributes)) dialog.showAndGet() @@ -58,7 +72,7 @@ class GetJobPropertiesAction : AnAction() { val selected = view.mySelectedNodesData val node = selected.getOrNull(0)?.node e.presentation.isVisible = selected.size == 1 - && (node is JobNode - || node is SpoolFileNode) + && (node is JobNode + || node is SpoolFileNode) } } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/HoldJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/HoldJobAction.kt index 7be580981..c276566f7 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/HoldJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/HoldJobAction.kt @@ -11,6 +11,7 @@ package org.zowe.explorer.explorer.actions import com.intellij.notification.NotificationType +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -24,6 +25,10 @@ import org.zowe.kotlinsdk.Job /** Action to hold a running job in the Jobs Tool Window */ class HoldJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun isDumbAware(): Boolean { return true } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/MigrationActions.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/MigrationActions.kt index fc304fe7d..fa80c4a25 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/MigrationActions.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/MigrationActions.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service import com.intellij.openapi.progress.runModalTask @@ -62,6 +63,10 @@ private fun makeUniqueCacheClean(nodes: List>) { */ class RecallAction : DumbAwareAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Runs recall operation */ @@ -116,6 +121,10 @@ class RecallAction : DumbAwareAction() { */ class MigrateAction : DumbAwareAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Runs migrate operation */ diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/PurgeJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/PurgeJobAction.kt index e913f7888..66dae88c9 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/PurgeJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/PurgeJobAction.kt @@ -1,6 +1,7 @@ package org.zowe.explorer.explorer.actions import com.intellij.notification.NotificationType +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -12,7 +13,12 @@ import org.zowe.explorer.dataops.DataOpsManager import org.zowe.explorer.dataops.attributes.RemoteJobAttributes import org.zowe.explorer.dataops.operations.jobs.BasicPurgeJobParams import org.zowe.explorer.dataops.operations.jobs.PurgeJobOperation -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.ExplorerTreeNode +import org.zowe.explorer.explorer.ui.FetchNode +import org.zowe.explorer.explorer.ui.JesExplorerView +import org.zowe.explorer.explorer.ui.JesFilterNode +import org.zowe.explorer.explorer.ui.JobNode +import org.zowe.explorer.explorer.ui.getExplorerView import org.zowe.explorer.ui.build.jobs.JOBS_LOG_VIEW import org.zowe.explorer.ui.build.jobs.JobBuildTreeView import org.zowe.kotlinsdk.ExecData @@ -22,6 +28,10 @@ import org.zowe.kotlinsdk.Job /** An action to purge a job */ class PurgeJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun isDumbAware(): Boolean { return true } @@ -134,6 +144,7 @@ class PurgeJobAction : AnAction() { } } } + /** * A job can be purged from the Jobs Tool Window * or from the JES Explorer by clicking on the corresponding job @@ -147,7 +158,7 @@ class PurgeJobAction : AnAction() { val selected = view.mySelectedNodesData val node = selected.getOrNull(0)?.node e.presentation.isVisible = selected.size == 1 - && node is JobNode + && node is JobNode } else if (view is JobBuildTreeView) { val jobStatus = view.getJobLogger().logFetcher.getCachedJobStatus()?.status if (jobStatus == null) { diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/RefreshNodeAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/RefreshNodeAction.kt index 84d25478f..2f6603f15 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/RefreshNodeAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/RefreshNodeAction.kt @@ -10,16 +10,24 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.common.ui.cleanInvalidateOnExpand -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.EXPLORER_VIEW +import org.zowe.explorer.explorer.ui.FetchNode +import org.zowe.explorer.explorer.ui.RefreshableNode +import org.zowe.explorer.explorer.ui.WorkingSetNode /** * Class which represents a refresh node action */ class RefreshNodeAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Overloaded method of AnAction abstract class. Tells what to do if an action was submitted */ diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/ReleaseJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/ReleaseJobAction.kt index ad13d6d7e..b2334f6f0 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/ReleaseJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/ReleaseJobAction.kt @@ -11,6 +11,7 @@ package org.zowe.explorer.explorer.actions import com.intellij.notification.NotificationType +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -24,6 +25,10 @@ import org.zowe.kotlinsdk.Job /** Action to release a holding job in the Jobs Tool Window */ class ReleaseJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun isDumbAware(): Boolean { return true } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/RenameAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/RenameAction.kt index c00ef5084..8a1004ad2 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/RenameAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/RenameAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -22,7 +23,15 @@ import org.zowe.explorer.dataops.attributes.RemoteDatasetAttributes import org.zowe.explorer.dataops.attributes.RemoteMemberAttributes import org.zowe.explorer.dataops.attributes.RemoteUssAttributes import org.zowe.explorer.dataops.operations.RenameOperation -import org.zowe.explorer.explorer.ui.* +import org.zowe.explorer.explorer.ui.ExplorerTreeNode +import org.zowe.explorer.explorer.ui.FileExplorerView +import org.zowe.explorer.explorer.ui.FileLikeDatasetNode +import org.zowe.explorer.explorer.ui.LibraryNode +import org.zowe.explorer.explorer.ui.RenameDialog +import org.zowe.explorer.explorer.ui.UssDirNode +import org.zowe.explorer.explorer.ui.UssFileNode +import org.zowe.explorer.explorer.ui.cleanCacheIfPossible +import org.zowe.explorer.explorer.ui.getExplorerView import org.zowe.explorer.vfs.MFVirtualFile /** @@ -32,6 +41,10 @@ import org.zowe.explorer.vfs.MFVirtualFile */ class RenameAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Method to run rename operation. It passes the control to rename operation runner * @param project the current project diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/SettingAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/SettingAction.kt index f337956e3..dc0601272 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/SettingAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/SettingAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.options.ShowSettingsUtil @@ -17,6 +18,10 @@ import org.zowe.explorer.config.MainframeConfigurable /** Action to show settings of the plugin */ class SettingAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + override fun actionPerformed(e: AnActionEvent) { ShowSettingsUtil.getInstance().showSettingsDialog(e.project, MainframeConfigurable::class.java) } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobAction.kt index a6fd0fc67..b4104eead 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -33,6 +34,10 @@ import org.zowe.explorer.utils.sendTopic */ class SubmitJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Called when submit option is chosen from context menu, * runs the submit operation @@ -99,6 +104,6 @@ class SubmitJobAction : AnAction() { val selected = view.mySelectedNodesData val node = selected.getOrNull(0)?.node e.presentation.isVisible = selected.size == 1 - && (node is FileLikeDatasetNode || node is UssFileNode) + && (node is FileLikeDatasetNode || node is UssFileNode) } } diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobToolbarAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobToolbarAction.kt index 8cb882b7c..3686f75ab 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobToolbarAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/SubmitJobToolbarAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys @@ -17,7 +18,8 @@ import com.intellij.openapi.components.service import com.intellij.openapi.progress.runBackgroundableTask import org.zowe.explorer.dataops.DataOpsManager import org.zowe.explorer.dataops.attributes.RemoteJobAttributes -import org.zowe.explorer.dataops.operations.jobs.* +import org.zowe.explorer.dataops.operations.jobs.SubmitJobJclOperationParams +import org.zowe.explorer.dataops.operations.jobs.SubmitJobOperation import org.zowe.explorer.explorer.FileExplorerContentProvider import org.zowe.explorer.ui.build.jobs.JOB_ADDED_TOPIC import org.zowe.explorer.utils.sendTopic @@ -25,7 +27,11 @@ import org.zowe.explorer.utils.sendTopic /** * Action to submit job using the button in editor when edit JCL */ -class SubmitJobToolbarAction: AnAction() { +class SubmitJobToolbarAction : AnAction() { + + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } /** * Submit a job on button click diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/TsoSessionCreateAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/TsoSessionCreateAction.kt index c2a250d00..9972f7880 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/TsoSessionCreateAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/TsoSessionCreateAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.components.service @@ -35,6 +36,10 @@ import org.zowe.explorer.utils.sendTopic class TsoSessionCreateAction : AnAction() { private val presentationText = "TSO Console" + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Method to perform an action which is called when OK button is pressed */ diff --git a/src/main/kotlin/org/zowe/explorer/explorer/actions/ViewJobAction.kt b/src/main/kotlin/org/zowe/explorer/explorer/actions/ViewJobAction.kt index 0fe43d4ca..b6ab4df05 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/actions/ViewJobAction.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/actions/ViewJobAction.kt @@ -10,6 +10,7 @@ package org.zowe.explorer.explorer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import org.zowe.explorer.dataops.DataOpsManager @@ -25,6 +26,10 @@ import org.zowe.explorer.utils.service /** An action to view a process of running job in the Jobs Tool Window */ class ViewJobAction : AnAction() { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** View a process of running job on click in the JES Explorer */ override fun actionPerformed(e: AnActionEvent) { val view = e.getExplorerView() ?: return diff --git a/src/main/kotlin/org/zowe/explorer/explorer/ui/ExplorerPasteProvider.kt b/src/main/kotlin/org/zowe/explorer/explorer/ui/ExplorerPasteProvider.kt index 020992aed..a28e316de 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/ui/ExplorerPasteProvider.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/ui/ExplorerPasteProvider.kt @@ -12,6 +12,7 @@ package org.zowe.explorer.explorer.ui import com.intellij.icons.AllIcons import com.intellij.ide.PasteProvider +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.actionSystem.DataContext import com.intellij.openapi.actionSystem.DataKey @@ -21,7 +22,6 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.ui.Messages import com.intellij.openapi.ui.showYesNoDialog import com.intellij.openapi.vfs.VirtualFile -import com.intellij.openapi.vfs.newvfs.impl.VirtualFileImpl import org.zowe.explorer.common.ui.cleanInvalidateOnExpand import org.zowe.explorer.dataops.DataOpsManager import org.zowe.explorer.dataops.attributes.RemoteDatasetAttributes @@ -110,6 +110,10 @@ class ExplorerPasteProvider : PasteProvider { it.attributes?.isPastePossible ?: true } + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** * Get nodes to refresh. Normally it would be some parent nodes that are changed during the copy/move operation. * E.g. for copy operation it will be parent node of the destination. For move operation it will be both source and destination nodes @@ -337,7 +341,8 @@ class ExplorerPasteProvider : PasteProvider { "Ok", "Skip This Files", AllIcons.General.WarningDialog - )) { + ) + ) { conflictsResolutions.addAll( ussOrLocalFileToPdsWarnings.map { ConflictResolution(it.second, it.first).apply { resolveBySkip() } } ) @@ -481,6 +486,7 @@ class ExplorerPasteProvider : PasteProvider { conflictsThatCannotBeOverwritten.map { ConflictResolution(it.second, it.first).apply { resolveBySkip() } } ) } + 1 -> { result.addAll(conflicts.map { ConflictResolution(it.second, it.first).apply { resolveByOverwrite() } }) result.addAll( @@ -539,7 +545,8 @@ class ExplorerPasteProvider : PasteProvider { allConflicts.forEach { conflict -> - val newName = dataOpsManager.getNameResolver(conflict.second, conflict.first).resolve(conflict.second, conflict.first) + val newName = + dataOpsManager.getNameResolver(conflict.second, conflict.first).resolve(conflict.second, conflict.first) val newNameMessage = "If you select option \"Use new name\", the following name will be selected: $newName" diff --git a/src/main/kotlin/org/zowe/explorer/explorer/ui/FileExplorerView.kt b/src/main/kotlin/org/zowe/explorer/explorer/ui/FileExplorerView.kt index 192ff18b8..ebe42bd01 100644 --- a/src/main/kotlin/org/zowe/explorer/explorer/ui/FileExplorerView.kt +++ b/src/main/kotlin/org/zowe/explorer/explorer/ui/FileExplorerView.kt @@ -11,7 +11,11 @@ package org.zowe.explorer.explorer.ui import com.intellij.icons.AllIcons -import com.intellij.ide.* +import com.intellij.ide.CopyPasteSupport +import com.intellij.ide.CopyProvider +import com.intellij.ide.CutProvider +import com.intellij.ide.DeleteProvider +import com.intellij.ide.PasteProvider import com.intellij.ide.dnd.DnDManager import com.intellij.ide.dnd.DnDSource import com.intellij.ide.dnd.DnDTarget @@ -19,6 +23,7 @@ import com.intellij.ide.dnd.FileCopyPasteUtil import com.intellij.ide.projectView.ProjectView import com.intellij.openapi.Disposable import com.intellij.openapi.actionSystem.ActionGroup +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.actionSystem.DataContext import com.intellij.openapi.actionSystem.PlatformDataKeys @@ -230,6 +235,10 @@ class FileExplorerView( */ inner class ExplorerCutProvider : CutProvider { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** @see ExplorerCopyPasteSupport.performCopyCut */ override fun performCut(dataContext: DataContext) { performCopyCut(true, dataContext) @@ -264,6 +273,10 @@ class FileExplorerView( override fun getCopyProvider(): CopyProvider { return object : CopyProvider { + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** @see ExplorerCopyPasteSupport.performCopyCut */ override fun performCopy(dataContext: DataContext) { performCopyCut(false, dataContext) @@ -411,6 +424,11 @@ class FileExplorerView( * @author Viktar Mushtsin. */ private val deleteProvider = object : DeleteProvider { + + override fun getActionUpdateThread(): ActionUpdateThread { + return ActionUpdateThread.EDT + } + /** Deletes files corresponding to the selected nodes data. */ override fun deleteElement(dataContext: DataContext) { val selected = mySelectedNodesData