diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncAction.kt
index 7cbad7647..a83dae148 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncAction.kt
@@ -10,9 +10,9 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.config.ConfigService
import eu.ibagroup.formainframe.dataops.DataOpsManager
-import eu.ibagroup.formainframe.utils.*
+import eu.ibagroup.formainframe.utils.castOrNull
+import eu.ibagroup.formainframe.utils.checkEncodingCompatibility
+import eu.ibagroup.formainframe.utils.runReadActionInEdtAndWait
+import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait
+import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/AddConnectionAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddConnectionAction.kt
index e7c8f2200..f621be9c7 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddConnectionAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddConnectionAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -21,7 +22,9 @@ import eu.ibagroup.formainframe.config.connect.ui.zosmf.ConnectionDialog
import eu.ibagroup.formainframe.config.connect.ui.zosmf.ConnectionDialogState
import eu.ibagroup.formainframe.config.connect.ui.zosmf.initEmptyUuids
import eu.ibagroup.formainframe.explorer.hints.Hint
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.EXPLORER_VIEW
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.JesExplorerView
import eu.ibagroup.formainframe.utils.castOrNull
import javax.swing.JComponent
import javax.swing.event.HyperlinkEvent
@@ -31,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(
@@ -76,7 +83,7 @@ private fun showHint(e: AnActionEvent) {
else -> null
}
val text = "Now you can add working set to browse
$content.
" +
- "Click here to add..."
+ "Click here to add..."
val hyperlinkAction = when (view) {
is FileExplorerView -> {
{ AddWorkingSetAction().actionPerformed(e) }
diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddJobsFilterAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddJobsFilterAction.kt
index 0724fc8ed..641acc0c9 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddJobsFilterAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddJobsFilterAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.config.connect.CredentialService
@@ -27,6 +28,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/AddMaskAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMaskAction.kt
index 60e2c192b..c4d15d797 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMaskAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMaskAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.config.ws.DSMask
@@ -26,6 +27,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt
index 17c1d42ee..415c60013 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -24,15 +25,28 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes
import eu.ibagroup.formainframe.dataops.attributes.RemoteMemberAttributes
import eu.ibagroup.formainframe.dataops.exceptions.CallException
import eu.ibagroup.formainframe.dataops.getAttributesService
-import eu.ibagroup.formainframe.dataops.operations.*
+import eu.ibagroup.formainframe.dataops.operations.DeleteMemberOperation
+import eu.ibagroup.formainframe.dataops.operations.DeleteMemberOperationParams
+import eu.ibagroup.formainframe.dataops.operations.MemberAllocationOperation
+import eu.ibagroup.formainframe.dataops.operations.MemberAllocationParams
import eu.ibagroup.formainframe.explorer.ExplorerUnit
import eu.ibagroup.formainframe.explorer.FilesWorkingSet
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.AddMemberDialog
+import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
+import eu.ibagroup.formainframe.explorer.ui.FetchNode
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.FileLikeDatasetNode
+import eu.ibagroup.formainframe.explorer.ui.LibraryNode
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.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
@@ -114,8 +128,8 @@ class AddMemberAction : AnAction() {
}
val selected = view.mySelectedNodesData.getOrNull(0)
e.presentation.isEnabledAndVisible = selected?.node is LibraryNode || (
- selected?.node is FileLikeDatasetNode && selected.attributes is RemoteMemberAttributes
- )
+ selected?.node is FileLikeDatasetNode && selected.attributes is RemoteMemberAttributes
+ )
}
}
diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddWsActionBase.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddWsActionBase.kt
index 716a84830..23b256e7c 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddWsActionBase.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddWsActionBase.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/AllocateActionBase.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateActionBase.kt
index 3fb0aa08d..52e995fb2 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateActionBase.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/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
@@ -50,6 +51,10 @@ const val ALLOCATE_ACTION_NOTIFICATION_GROUP_ID = "eu.ibagroup.formainframe.expl
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/eu/ibagroup/formainframe/explorer/actions/CancelJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CancelJobAction.kt
index f9c4e008d..8e458f614 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CancelJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CancelJobAction.kt
@@ -11,6 +11,7 @@
package eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt
index 07b513e1b..84dc99ba6 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -30,7 +31,14 @@ import eu.ibagroup.formainframe.dataops.operations.UssAllocationOperation
import eu.ibagroup.formainframe.dataops.operations.UssAllocationParams
import eu.ibagroup.formainframe.dataops.operations.UssChangeModeOperation
import eu.ibagroup.formainframe.dataops.operations.UssChangeModeParams
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.CreateFileDialog
+import eu.ibagroup.formainframe.explorer.ui.CreateFileDialogState
+import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.UssDirNode
+import eu.ibagroup.formainframe.explorer.ui.UssFileNode
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
+import eu.ibagroup.formainframe.explorer.ui.toAllocationParams
import eu.ibagroup.formainframe.utils.castOrNull
import eu.ibagroup.formainframe.vfs.MFVirtualFile
import org.zowe.kotlinsdk.ChangeMode
@@ -41,6 +49,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/eu/ibagroup/formainframe/explorer/actions/DeleteJesNodeAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DeleteJesNodeAction.kt
index 6d14cd447..343748550 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DeleteJesNodeAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DeleteJesNodeAction.kt
@@ -11,6 +11,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/DuplicateMemberAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DuplicateMemberAction.kt
index 487477e5c..7b2a5739b 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DuplicateMemberAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/DuplicateMemberAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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,13 +23,24 @@ import eu.ibagroup.formainframe.config.connect.ConnectionConfig
import eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.dataops.attributes.RemoteMemberAttributes
import eu.ibagroup.formainframe.dataops.operations.RenameOperation
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeView
+import eu.ibagroup.formainframe.explorer.ui.FetchNode
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.FileLikeDatasetNode
+import eu.ibagroup.formainframe.explorer.ui.NodeData
+import eu.ibagroup.formainframe.explorer.ui.RenameDialog
+import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
+import eu.ibagroup.formainframe.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
*/
@@ -54,7 +66,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
@@ -102,7 +119,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/eu/ibagroup/formainframe/explorer/actions/EditFilesWorkingSetAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditFilesWorkingSetAction.kt
index 5c8f56fa8..699a330ff 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditFilesWorkingSetAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditFilesWorkingSetAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/EditJclAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJclAction.kt
index 5b96bdc29..19c773d17 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJclAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJclAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.vfs.MFVirtualFile
*/
class EditJclAction : AnAction() {
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.EDT
+ }
+
override fun isDumbAware(): Boolean {
return true
}
diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJesWorkingSetAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJesWorkingSetAction.kt
index a6a808a39..0bddfa674 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJesWorkingSetAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJesWorkingSetAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/EditJobsFilterAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJobsFilterAction.kt
index 35e3cf677..3394323d4 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJobsFilterAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditJobsFilterAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.config.configCrudable
@@ -29,6 +30,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/EditMaskAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditMaskAction.kt
index fd541a7b0..c8e1a78f9 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditMaskAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/EditMaskAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.config.configCrudable
@@ -34,6 +35,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/ForceRenameAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ForceRenameAction.kt
index cd9abec75..2247479fb 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ForceRenameAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ForceRenameAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -26,7 +27,14 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteUssAttributes
import eu.ibagroup.formainframe.dataops.operations.ForceRenameOperation
import eu.ibagroup.formainframe.dataops.operations.RenameOperation
import eu.ibagroup.formainframe.explorer.Explorer
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.NodeData
+import eu.ibagroup.formainframe.explorer.ui.RenameDialog
+import eu.ibagroup.formainframe.explorer.ui.UssDirNode
+import eu.ibagroup.formainframe.explorer.ui.UssFileNode
+import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.vfs.MFVirtualFile
/**
@@ -34,6 +42,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/GetFilePropertiesAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetFilePropertiesAction.kt
index 591c8964a..dffaadf72 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetFilePropertiesAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetFilePropertiesAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.dataops.attributes.RemoteUssAttributes
import eu.ibagroup.formainframe.dataops.operations.UssChangeModeOperation
import eu.ibagroup.formainframe.dataops.operations.UssChangeModeParams
import eu.ibagroup.formainframe.explorer.ExplorerUnit
-import eu.ibagroup.formainframe.explorer.ui.*
-import eu.ibagroup.formainframe.utils.*
+import eu.ibagroup.formainframe.explorer.ui.DatasetPropertiesDialog
+import eu.ibagroup.formainframe.explorer.ui.DatasetState
+import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.FileLikeDatasetNode
+import eu.ibagroup.formainframe.explorer.ui.LibraryNode
+import eu.ibagroup.formainframe.explorer.ui.MemberPropertiesDialog
+import eu.ibagroup.formainframe.explorer.ui.MemberState
+import eu.ibagroup.formainframe.explorer.ui.UssDirNode
+import eu.ibagroup.formainframe.explorer.ui.UssFileNode
+import eu.ibagroup.formainframe.explorer.ui.UssFilePropertiesDialog
+import eu.ibagroup.formainframe.explorer.ui.UssFileState
+import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
+import eu.ibagroup.formainframe.utils.changeFileEncodingAction
+import eu.ibagroup.formainframe.utils.clone
+import eu.ibagroup.formainframe.utils.isBeingEditingNow
+import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/GetJobPropertiesAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetJobPropertiesAction.kt
index 6e5115036..a1b4723ec 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetJobPropertiesAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/GetJobPropertiesAction.kt
@@ -10,18 +10,31 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.config.connect.ConnectionConfig
import eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.dataops.attributes.RemoteJobAttributes
import eu.ibagroup.formainframe.dataops.attributes.RemoteSpoolFileAttributes
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
+import eu.ibagroup.formainframe.explorer.ui.JesExplorerView
+import eu.ibagroup.formainframe.explorer.ui.JobNode
+import eu.ibagroup.formainframe.explorer.ui.JobPropertiesDialog
+import eu.ibagroup.formainframe.explorer.ui.JobState
+import eu.ibagroup.formainframe.explorer.ui.SpoolFileNode
+import eu.ibagroup.formainframe.explorer.ui.SpoolFilePropertiesDialog
+import eu.ibagroup.formainframe.explorer.ui.SpoolFileState
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/HoldJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/HoldJobAction.kt
index 47e3a0dad..a130f7e43 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/HoldJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/HoldJobAction.kt
@@ -11,6 +11,7 @@
package eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/MigrationActions.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/MigrationActions.kt
index fa062d54b..119e9a4ed 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/MigrationActions.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/MigrationActions.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -26,7 +27,11 @@ import eu.ibagroup.formainframe.dataops.operations.migration.MigrateOperationPar
import eu.ibagroup.formainframe.dataops.operations.migration.RecallOperation
import eu.ibagroup.formainframe.dataops.operations.migration.RecallOperationParams
import eu.ibagroup.formainframe.explorer.FilesWorkingSet
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
+import eu.ibagroup.formainframe.explorer.ui.ExplorerUnitTreeNodeBase
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.vfs.MFVirtualFile
/**
@@ -61,6 +66,10 @@ private fun makeUniqueCacheClean(nodes: List>) {
*/
class RecallAction : DumbAwareAction() {
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.EDT
+ }
+
/**
* Runs recall operation
*/
@@ -117,6 +126,10 @@ class RecallAction : DumbAwareAction() {
*/
class MigrateAction : DumbAwareAction() {
+ override fun getActionUpdateThread(): ActionUpdateThread {
+ return ActionUpdateThread.EDT
+ }
+
/**
* Runs migrate operation
*/
diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt
index 4ec73775f..ad6f1f267 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt
@@ -1,6 +1,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.dataops.attributes.RemoteJobAttributes
import eu.ibagroup.formainframe.dataops.operations.jobs.BasicPurgeJobParams
import eu.ibagroup.formainframe.dataops.operations.jobs.PurgeJobOperation
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
+import eu.ibagroup.formainframe.explorer.ui.FetchNode
+import eu.ibagroup.formainframe.explorer.ui.JesExplorerView
+import eu.ibagroup.formainframe.explorer.ui.JesFilterNode
+import eu.ibagroup.formainframe.explorer.ui.JobNode
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.ui.build.jobs.JOBS_LOG_VIEW
import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/RefreshNodeAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RefreshNodeAction.kt
index 01bd83aa8..b2c15ef59 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RefreshNodeAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RefreshNodeAction.kt
@@ -10,16 +10,24 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.common.ui.cleanInvalidateOnExpand
-import eu.ibagroup.formainframe.explorer.ui.*
+import eu.ibagroup.formainframe.explorer.ui.EXPLORER_VIEW
+import eu.ibagroup.formainframe.explorer.ui.FetchNode
+import eu.ibagroup.formainframe.explorer.ui.RefreshableNode
+import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/ReleaseJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ReleaseJobAction.kt
index eda86cedb..ca0ca8e56 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ReleaseJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ReleaseJobAction.kt
@@ -11,6 +11,7 @@
package eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt
index 9780d4608..60e49a0f2 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -25,9 +26,15 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes
import eu.ibagroup.formainframe.dataops.attributes.RemoteMemberAttributes
import eu.ibagroup.formainframe.dataops.attributes.RemoteUssAttributes
import eu.ibagroup.formainframe.dataops.operations.RenameOperation
-import eu.ibagroup.formainframe.explorer.ui.*
-import eu.ibagroup.formainframe.utils.clone
-import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey
+import eu.ibagroup.formainframe.explorer.ui.ExplorerTreeNode
+import eu.ibagroup.formainframe.explorer.ui.FileExplorerView
+import eu.ibagroup.formainframe.explorer.ui.FileLikeDatasetNode
+import eu.ibagroup.formainframe.explorer.ui.LibraryNode
+import eu.ibagroup.formainframe.explorer.ui.RenameDialog
+import eu.ibagroup.formainframe.explorer.ui.UssDirNode
+import eu.ibagroup.formainframe.explorer.ui.UssFileNode
+import eu.ibagroup.formainframe.explorer.ui.cleanCacheIfPossible
+import eu.ibagroup.formainframe.explorer.ui.getExplorerView
import eu.ibagroup.formainframe.vfs.MFVirtualFile
/**
@@ -37,6 +44,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/SettingAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SettingAction.kt
index 265abb247..9af42c9af 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SettingAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SettingAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/SubmitJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobAction.kt
index b8aeda490..7dc737d97 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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
@@ -36,6 +37,10 @@ import eu.ibagroup.formainframe.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
@@ -103,6 +108,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/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt
index e969ba2af..04e6fd9ea 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.dataops.DataOpsManager
import eu.ibagroup.formainframe.dataops.attributes.RemoteJobAttributes
-import eu.ibagroup.formainframe.dataops.operations.jobs.*
+import eu.ibagroup.formainframe.dataops.operations.jobs.SubmitJobJclOperationParams
+import eu.ibagroup.formainframe.dataops.operations.jobs.SubmitJobOperation
import eu.ibagroup.formainframe.explorer.FileExplorerContentProvider
import eu.ibagroup.formainframe.ui.build.jobs.JOB_ADDED_TOPIC
import eu.ibagroup.formainframe.utils.sendTopic
@@ -25,7 +27,11 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/TsoSessionCreateAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/TsoSessionCreateAction.kt
index 08d1d909e..923610726 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/TsoSessionCreateAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/TsoSessionCreateAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/actions/ViewJobAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ViewJobAction.kt
index c388fdd71..17906cfbf 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ViewJobAction.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ViewJobAction.kt
@@ -10,6 +10,7 @@
package eu.ibagroup.formainframe.explorer.actions
+import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import eu.ibagroup.formainframe.dataops.DataOpsManager
@@ -25,6 +26,10 @@ import eu.ibagroup.formainframe.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/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProvider.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProvider.kt
index 8942af158..87f4b79bb 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProvider.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProvider.kt
@@ -12,6 +12,7 @@ package eu.ibagroup.formainframe.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 eu.ibagroup.formainframe.analytics.AnalyticsService
import eu.ibagroup.formainframe.analytics.events.FileAction
import eu.ibagroup.formainframe.analytics.events.FileEvent
@@ -113,6 +113,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
@@ -349,7 +353,8 @@ class ExplorerPasteProvider : PasteProvider {
"Ok",
"Skip This Files",
AllIcons.General.WarningDialog
- )) {
+ )
+ ) {
conflictsResolutions.addAll(
ussOrLocalFileToPdsWarnings.map { ConflictResolution(it.second, it.first).apply { resolveBySkip() } }
)
@@ -493,6 +498,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(
@@ -551,7 +557,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/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt
index 3ca1e73fc..d9bf75b7c 100644
--- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt
+++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt
@@ -11,7 +11,11 @@
package eu.ibagroup.formainframe.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
@@ -233,6 +238,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)
@@ -268,6 +277,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)
@@ -416,6 +429,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