From c7b676b53923c719300c8eba3ae397d03997dc5b Mon Sep 17 00:00:00 2001 From: "vkrus@ibagroup.eu" Date: Tue, 16 May 2023 16:32:30 +0300 Subject: [PATCH 01/22] IJMP-1044: error message is not displayed now. --- .../dataops/operations/mover/SequentialToPdsMover.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt index e9a660261..053282556 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt @@ -9,6 +9,7 @@ */ package eu.ibagroup.formainframe.dataops.operations.mover +import com.intellij.openapi.progress.ProgressIndicator import eu.ibagroup.formainframe.api.api import eu.ibagroup.formainframe.config.connect.ConnectionConfig import eu.ibagroup.formainframe.config.connect.authToken @@ -81,4 +82,14 @@ class SequentialToPdsMover(dataOpsManager: DataOpsManager) : DefaultFileMover(da memberName = memberName ) } + + override fun run(operation: MoveCopyOperation, progressIndicator: ProgressIndicator) { + runCatching { + super.run(operation, progressIndicator) + }.onFailure { + if (it.message?.contains("data set is empty") == false) { + throw it + } + } + } } From d77a5fbfd95efaf22e964af96f824399b62ce7f0 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Wed, 17 May 2023 21:18:55 +0200 Subject: [PATCH 02/22] IJMP-1128 Preparing 1.0.2-223 --- .../eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt | 2 +- .../eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt index 21a4e45b0..9efe12adb 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt @@ -80,4 +80,4 @@ class MFPastePreprocessor : CopyPastePostProcessor() } super.processTransferableData(project, editor, bounds, caretOffset, indented, values) } -} \ No newline at end of file +} 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 92105d0ae..900d8142b 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt @@ -569,4 +569,3 @@ data class NodeData( /** Type alias for fetch node with any possible generic types. */ typealias FetchNode = FileFetchNode<*, *, *, *, *> - From 1b286c95cb4c85b5204155b3814882a104bb47ef Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Wed, 17 May 2023 21:22:24 +0200 Subject: [PATCH 03/22] IJMP-1128 Preparing v1.0.2-223 --- .../formainframe/editor/MFPastePreprocessor.kt | 18 ------------------ .../explorer/actions/AddMemberAction.kt | 1 - .../explorer/actions/AllocateDatasetAction.kt | 1 - .../actions/ChangeContentModeAction.kt | 1 - .../explorer/actions/CreateUssEntityAction.kt | 1 - .../explorer/actions/PurgeJobAction.kt | 1 - .../explorer/actions/RenameAction.kt | 1 - .../explorer/ui/ExplorerTreeNode.kt | 1 - .../explorer/ui/ExplorerWindowFactory.kt | 3 +-- .../explorer/ui/FileExplorerView.kt | 1 - .../explorer/ui/FileLikeDatasetNode.kt | 1 - 11 files changed, 1 insertion(+), 29 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt index 215aa933b..d4439aca9 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt @@ -43,24 +43,6 @@ class MFPastePreprocessor : CopyPastePostProcessor() return DATA_FLAVOR } - // This function is not needed to be overridden since v1.0.2-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun getOffsetCount(): Int { - return 0 - } - - // This function is not needed to be overridden since v1.0.2-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun getOffsets(offsets: IntArray?, index: Int): Int { - return index - } - - // This function is not needed to be overridden since v1.0.2-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun setOffsets(offsets: IntArray?, index: Int): Int { - return index - } - companion object { private val DATA_FLAVOR = DataFlavor(MFPastePreprocessor::class.java, "class: ChangeContentByPasteAction") } 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 5ec8ed20f..920c8557e 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt @@ -26,7 +26,6 @@ import eu.ibagroup.formainframe.dataops.getAttributesService import eu.ibagroup.formainframe.dataops.operations.* import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.explorer.ui.* -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile /** Class that represents "Add member" action */ diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt index 04083df32..f5a0e2308 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt @@ -37,7 +37,6 @@ import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.castOrNull import eu.ibagroup.formainframe.utils.clone import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.r2z.* /** diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt index c7ae014f2..0bb24ff65 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt @@ -20,7 +20,6 @@ import eu.ibagroup.formainframe.dataops.attributes.* import eu.ibagroup.formainframe.explorer.ui.FILE_EXPLORER_VIEW import eu.ibagroup.formainframe.explorer.ui.FileExplorerView import eu.ibagroup.formainframe.utils.sendTopic -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import eu.ibagroup.r2z.XIBMDataType 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 b182fa310..6efee375c 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt @@ -32,7 +32,6 @@ import eu.ibagroup.formainframe.dataops.operations.UssChangeModeOperation import eu.ibagroup.formainframe.dataops.operations.UssChangeModeParams import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.castOrNull -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import eu.ibagroup.r2z.ChangeMode import eu.ibagroup.r2z.FileType 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 2ee218808..f6f7598e1 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt @@ -15,7 +15,6 @@ import eu.ibagroup.formainframe.dataops.operations.jobs.PurgeJobOperation import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.ui.build.jobs.JOBS_LOG_VIEW import eu.ibagroup.formainframe.ui.build.jobs.JobBuildTreeView -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.r2z.ExecData import eu.ibagroup.r2z.JESApi import eu.ibagroup.r2z.Job 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 1ac0b6938..8b483f602 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt @@ -32,7 +32,6 @@ import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.clone import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater /** * Class which represents a rename action diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt index 0a70c14aa..73fe0cc78 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt @@ -34,7 +34,6 @@ import eu.ibagroup.formainframe.explorer.Explorer import eu.ibagroup.formainframe.explorer.UIComponentManager import eu.ibagroup.formainframe.utils.isBeingEditingNow import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import javax.swing.tree.TreePath diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerWindowFactory.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerWindowFactory.kt index b42fdda32..74a9ab14f 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerWindowFactory.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerWindowFactory.kt @@ -26,8 +26,7 @@ class ExplorerWindowFactory : ToolWindowFactory, DumbAware { } override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { - // TODO: ContentFactory.SERVICE.getInstance() -> ContentFactory.getInstance() in new versions of the plugin - val contentFactory = ContentFactory.SERVICE.getInstance() + val contentFactory = ContentFactory.getInstance() UIComponentManager.INSTANCE.getExplorerContentProviders>().forEach { val content = contentFactory .createContent(it.buildExplorerContent(toolWindow.disposable, project), it.displayName, it.isLockable) 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 70dbcd430..900d8142b 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt @@ -40,7 +40,6 @@ import eu.ibagroup.formainframe.explorer.Explorer import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.utils.getMinimalCommonParents import eu.ibagroup.formainframe.utils.getParentsChain -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import java.awt.Toolkit import java.awt.datatransfer.DataFlavor diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt index f474120fb..deef63ca3 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt @@ -24,7 +24,6 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes import eu.ibagroup.formainframe.dataops.attributes.RemoteMemberAttributes import eu.ibagroup.formainframe.dataops.getAttributesService import eu.ibagroup.formainframe.explorer.ExplorerUnit -import eu.ibagroup.formainframe.utils.service // TODO: remove in 1.0.2-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import icons.ForMainframeIcons From 3180578866a67d47fe912850802536cb79270ecb Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Wed, 17 May 2023 21:28:17 +0200 Subject: [PATCH 04/22] IJMP-1128 Preparing v1.0.2-223 --- build.gradle.kts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 84b77167a..97f607016 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -21,7 +21,7 @@ apply(plugin = "kotlin") apply(plugin = "org.jetbrains.intellij") group = "eu.ibagroup" -version = "1.0.2-221" +version = "1.0.2-223" val remoteRobotVersion = "0.11.16" repositories { @@ -46,8 +46,8 @@ repositories { } java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } dependencies { @@ -73,23 +73,23 @@ dependencies { } intellij { - version.set("2022.1") + version.set("2022.3") } tasks { withType { kotlinOptions { - jvmTarget = JavaVersion.VERSION_11.toString() + jvmTarget = JavaVersion.VERSION_17.toString() languageVersion = org.jetbrains.kotlin.config.LanguageVersion.LATEST_STABLE.versionString } } patchPluginXml { - sinceBuild.set("221.5080") - untilBuild.set("222.*") + sinceBuild.set("223.7571") + untilBuild.set("223.*") changeNotes.set( """ - WARNING: version 1.0 introduces breaking change. You won't be able to use the plugin with IntelliJ version less than 2022.1 + WARNING: version 1.0 introduces breaking change. You won't be able to use the plugin with IntelliJ version less than 2022.3

New features: From 9df9ef40066d511f3697ea650acc0c25dfe1de2d Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Mon, 22 May 2023 17:21:58 +0200 Subject: [PATCH 05/22] Fixes for v1.1.0-221 --- .../ibagroup/formainframe/config/ConfigSandboxImpl.kt | 9 +++++---- .../config/connect/ui/CollectedConfigurable.kt | 10 +++++++--- .../formainframe/config/ws/ui/AbstractWsDialog.kt | 1 + .../dataops/fetch/RemoteFileFetchProviderBase.kt | 8 ++++++-- .../kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt | 1 + 5 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt index b529b6cba..4b19c81a5 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt @@ -20,6 +20,7 @@ import eu.ibagroup.formainframe.utils.crudable.EntityWithUuid import eu.ibagroup.formainframe.utils.crudable.ReloadableEventHandler import eu.ibagroup.formainframe.utils.isThe import eu.ibagroup.formainframe.utils.isTheSameAs +import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** Stateful class to represent the plugin configs sandbox */ data class SandboxState( @@ -129,10 +130,10 @@ class ConfigSandboxImpl : ConfigSandbox { /** Fully initialized config sandbox crudable object */ override val crudable by lazy { - makeCrudableWithoutListeners(true, { state.credentials }) { state.configState } - .configureCrudable { - eventHandler = this@ConfigSandboxImpl.eventHandler - } + makeCrudableWithoutListeners(true, { state.credentials }) { state.configState } + .configureCrudable { + eventHandler = this@ConfigSandboxImpl.eventHandler + } } /** Registers collection for config class in [ConfigStateV2.collections] in [state] and [initialState]. */ diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt index aa7c1dcd7..f676702ec 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt @@ -22,7 +22,7 @@ import javax.swing.BoxLayout */ class CollectedConfigurable( val configurables: List -): BoundSearchableConfigurable("Connections", "mainframe") { +) : BoundSearchableConfigurable("Connections", "mainframe") { /** Min width of one configuration panel inside. */ private val PANEL_MIN_HEIGHT = 240 @@ -32,8 +32,12 @@ class CollectedConfigurable( mainPanel.layout = BoxLayout(mainPanel, BoxLayout.Y_AXIS) configurables.forEach { val p = it.createComponent() - p.minimumSize = Dimension(p.width, PANEL_MIN_HEIGHT) - p.preferredSize = Dimension(p.width, PANEL_MIN_HEIGHT) + // TODO: use next line instead in v1.*.*-223 and greater: + // p.minimumSize = Dimension(p.width, PANEL_MIN_HEIGHT) + p?.minimumSize = Dimension(p?.width ?: 0, PANEL_MIN_HEIGHT) + // TODO: use next line instead in v1.*.*-223 and greater: + // p.preferredSize = Dimension(p.width, PANEL_MIN_HEIGHT) + p?.preferredSize = Dimension(p?.width ?: 0, PANEL_MIN_HEIGHT) mainPanel.add(p) } return mainPanel diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt index 6bda9a3e3..ab182033f 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt @@ -32,6 +32,7 @@ import eu.ibagroup.formainframe.utils.validateForBlank import eu.ibagroup.formainframe.utils.validateWorkingSetName import java.awt.Dimension import javax.swing.JComponent +import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** * Abstract class for displaying configuration dialog of single Working Set. diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt index 439122802..3588970e1 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt @@ -27,12 +27,13 @@ import eu.ibagroup.formainframe.utils.sendTopic import java.util.concurrent.locks.ReentrantLock import kotlin.collections.set import kotlin.concurrent.withLock +import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** * Abstract class that represents a base fetch provider for fetching remote files. * @param dataOpsManager instance of DataOpsManager service. */ -abstract class RemoteFileFetchProviderBase( +abstract class RemoteFileFetchProviderBase( private val dataOpsManager: DataOpsManager ) : FileFetchProvider, File> { @@ -104,7 +105,10 @@ abstract class RemoteFileFetchProviderBase, progressIndicator: ProgressIndicator): List { + private fun getFetchedFiles( + query: RemoteQuery, + progressIndicator: ProgressIndicator + ): List { val fetched = fetchResponse(query, progressIndicator) return runWriteActionOnWriteThread { fetched.mapNotNull { diff --git a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt index 81371961b..7dfd075e4 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt @@ -21,6 +21,7 @@ import java.util.stream.Stream import java.util.stream.StreamSupport import kotlin.concurrent.thread import kotlin.concurrent.withLock +import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** From cdb664cfad5ea1035eed7d24b2ce9ec41045ea5c Mon Sep 17 00:00:00 2001 From: Valiantsin Krus Date: Tue, 23 May 2023 12:02:27 +0300 Subject: [PATCH 06/22] IJMP-1138: empty dataset is deleted now after move. --- .../connect/ui/CollectedConfigurable.kt | 12 ++-- .../operations/mover/SequentialToPdsMover.kt | 56 +++++++++++++------ 2 files changed, 45 insertions(+), 23 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt index f676702ec..f155a8a38 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/connect/ui/CollectedConfigurable.kt @@ -32,13 +32,11 @@ class CollectedConfigurable( mainPanel.layout = BoxLayout(mainPanel, BoxLayout.Y_AXIS) configurables.forEach { val p = it.createComponent() - // TODO: use next line instead in v1.*.*-223 and greater: - // p.minimumSize = Dimension(p.width, PANEL_MIN_HEIGHT) - p?.minimumSize = Dimension(p?.width ?: 0, PANEL_MIN_HEIGHT) - // TODO: use next line instead in v1.*.*-223 and greater: - // p.preferredSize = Dimension(p.width, PANEL_MIN_HEIGHT) - p?.preferredSize = Dimension(p?.width ?: 0, PANEL_MIN_HEIGHT) - mainPanel.add(p) + p?.let { + p.minimumSize = Dimension(p.width, PANEL_MIN_HEIGHT) + p.preferredSize = Dimension(p.width, PANEL_MIN_HEIGHT) + mainPanel.add(p) + } } return mainPanel } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt index 053282556..e63943d08 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/operations/mover/SequentialToPdsMover.kt @@ -15,13 +15,13 @@ import eu.ibagroup.formainframe.config.connect.ConnectionConfig import eu.ibagroup.formainframe.config.connect.authToken import eu.ibagroup.formainframe.dataops.DataOpsManager import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes -import eu.ibagroup.formainframe.dataops.attributes.Requester +import eu.ibagroup.formainframe.dataops.exceptions.CallException import eu.ibagroup.formainframe.dataops.operations.OperationRunner import eu.ibagroup.formainframe.dataops.operations.OperationRunnerFactory +import eu.ibagroup.formainframe.utils.cancelByIndicator import eu.ibagroup.formainframe.utils.getParentsChain import org.zowe.kotlinsdk.CopyDataZOS import org.zowe.kotlinsdk.DataAPI -import retrofit2.Call /** * Factory for registering SequentialToPdsMover in Intellij IoC container. @@ -38,7 +38,7 @@ class SequentialToPdsMoverFactory : OperationRunnerFactory { * Implements copying of sequential data set to partitioned data set inside 1 system. * @author Viktar Mushtsin */ -class SequentialToPdsMover(dataOpsManager: DataOpsManager) : DefaultFileMover(dataOpsManager) { +class SequentialToPdsMover(val dataOpsManager: DataOpsManager) : AbstractFileMover() { /** * Checks that source is sequential data set, destination is partitioned data set, @@ -58,20 +58,21 @@ class SequentialToPdsMover(dataOpsManager: DataOpsManager) : DefaultFileMover(da * Builds call for copying sequential data set to partitioned data set. * @see DefaultFileMover.buildCall */ - override fun buildCall( + private fun proceedMoveCopyToPds( + connectionConfig: ConnectionConfig, operation: MoveCopyOperation, - requesterWithUrl: Pair, ConnectionConfig> - ): Call { + progressIndicator: ProgressIndicator + ): Throwable? { val destinationAttributes = operation.destinationAttributes as RemoteDatasetAttributes var memberName: String val dataset = (operation.sourceAttributes as RemoteDatasetAttributes).also { memberName = it.name.split(".").last() } - return api( - url = requesterWithUrl.second.url, - isAllowSelfSigned = requesterWithUrl.second.isAllowSelfSigned + val response = api( + url = connectionConfig.url, + isAllowSelfSigned = connectionConfig.isAllowSelfSigned ).copyToDatasetMember( - authorizationToken = requesterWithUrl.first.connectionConfig.authToken, + authorizationToken = connectionConfig.authToken, body = CopyDataZOS.CopyFromDataset( dataset = CopyDataZOS.CopyFromDataset.Dataset( datasetName = dataset.name @@ -80,16 +81,39 @@ class SequentialToPdsMover(dataOpsManager: DataOpsManager) : DefaultFileMover(da ), toDatasetName = destinationAttributes.name, memberName = memberName - ) + ).cancelByIndicator(progressIndicator).execute() + + if (!response.isSuccessful && response.errorBody()?.string()?.contains("data set is empty") == true) { + if (operation.isMove) { + val deleteResponse = api( + url = connectionConfig.url, + isAllowSelfSigned = connectionConfig.isAllowSelfSigned + ).deleteDataset( + authorizationToken = connectionConfig.authToken, + datasetName = dataset.name + ).cancelByIndicator(progressIndicator).execute() + if (!deleteResponse.isSuccessful) { + return CallException(deleteResponse, "Cannot delete source dataset '${dataset.name}'.") + } + } + } else if (!response.isSuccessful) { + return CallException(response, "Cannot move dataset '${dataset.name}'.") + } + return null } override fun run(operation: MoveCopyOperation, progressIndicator: ProgressIndicator) { - runCatching { - super.run(operation, progressIndicator) - }.onFailure { - if (it.message?.contains("data set is empty") == false) { - throw it + var throwable: Throwable? = null + for ((requester, _) in operation.commonUrls(dataOpsManager)) { + try { + throwable = proceedMoveCopyToPds(requester.connectionConfig, operation, progressIndicator) + break + } catch (t: Throwable) { + throwable = t } } + if (throwable != null) { + throw throwable + } } } From 7cd1e8e04780c15e92dab67dc1bf964d6b0641fa Mon Sep 17 00:00:00 2001 From: Arseni Tsikhamirau Date: Tue, 23 May 2023 17:13:46 +0200 Subject: [PATCH 07/22] IJMP-1140-Fix-ExplorerPasteProvider-tests 1) tests fixed + commented out obsolete code for IDEA version 221 --- .../ui/ExplorerPasteProviderTestSpec.kt | 26 ++++++++++++++++--- .../formainframe/explorer/ui/dummyClasses.kt | 7 ++--- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt index f6ccb257d..127c52cd3 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt @@ -99,11 +99,11 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ every { mockedCopyPasterProvider.getSourceFilesFromClipboard() } returns mockedClipboardBuffer every { mockedFileExplorerView.isCut } returns AtomicBoolean(true) - every { mockedFileExplorerView.ignoreVFileDeleteEvents } returns AtomicBoolean(false) + every { mockedFileExplorerView.ignoreVFSChangeEvents } returns AtomicBoolean(false) every { mockedFileExplorerView.copyPasteSupport } returns mockedCopyPasterProvider mockkObject(FileExplorerContentProvider) - mockkObject(FileExplorerContentProvider::getInstance) + //mockkObject(FileExplorerContentProvider::getInstance) every { FileExplorerContentProvider.getInstance().getExplorerView(any() as Project) } returns mockedFileExplorerView var isPastePerformed : Boolean @@ -538,6 +538,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ ) } returns mutableListOf(Pair(mockedSourceFile, mockedSourceFile)) + every { mockedSourceFile.findChild(any() as String) } returns null mockedExplorerPasteProvider.performPaste(mockedDataContext) assertSoftly { @@ -728,6 +729,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile1 = mockk() val mockedSourceAttributes1 = mockk() every { mockedSourceFile1.name } returns "test1" + every { mockedSourceFile1.isDirectory } returns false every { mockedSourceAttributes1.isPastePossible } returns false every { mockedSourceAttributes1.isDirectory } returns false every { mockedSourceNodeData1.node } returns mockedSourceNode1 @@ -740,6 +742,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile2 = mockk() val mockedSourceAttributes2 = mockk() every { mockedSourceFile2.name } returns "test2" + every { mockedSourceFile2.isDirectory } returns true every { mockedSourceAttributes2.isPastePossible } returns false every { mockedSourceAttributes2.isDirectory } returns false every { mockedSourceNodeData2.node } returns mockedSourceNode2 @@ -752,6 +755,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile3 = mockk() val mockedSourceAttributes3 = mockk() every { mockedSourceFile3.name } returns "test1" + every { mockedSourceFile3.isDirectory } returns false every { mockedSourceAttributes3.isPastePossible } returns false every { mockedSourceAttributes3.isDirectory } returns false every { mockedSourceNodeData3.node } returns mockedSourceNode3 @@ -788,8 +792,9 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile6 = mockk() val mockedSourceAttributes6 = mockk() every { mockedSourceFile6.name } returns "test1" + every { mockedSourceFile6.isDirectory } returns true every { mockedSourceAttributes6.isPastePossible } returns false - every { mockedSourceAttributes6.isDirectory } returns false + every { mockedSourceAttributes6.isDirectory } returns true every { mockedSourceNodeData6.node } returns mockedSourceNode6 every { mockedSourceNodeData6.file } returns mockedSourceFile6 every { mockedSourceNodeData6.attributes } returns mockedSourceAttributes6 @@ -797,18 +802,25 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ // children of target val childDestinationVirtualFile1 = mockk() every { childDestinationVirtualFile1.name } returns "test1" + every { childDestinationVirtualFile1.isDirectory } returns true val childDestinationVirtualFile2 = mockk() every { childDestinationVirtualFile2.name } returns "test_mf_file" val childDestMFFile2Attr = mockk() + val childDestinationVirtualFile3 = mockk() + every { childDestinationVirtualFile3.name } returns "test2" + every { childDestinationVirtualFile3.isDirectory } returns false // target to paste val mockedTargetFile1 = mockk() val mockedTargetFile2 = mockk() + val mockedTargetFile3 = mockk() val mockedTargetFile2Attributes = mockk() val mockedStructureTreeModelNodeTarget = mockk() val mockedNodeTarget = mockk() every { mockedTargetFile1.name } returns "test_folder" every { mockedTargetFile1.children } returns arrayOf(childDestinationVirtualFile1) + every { mockedTargetFile3.name } returns "test_folder2" + every { mockedTargetFile3.children } returns arrayOf(childDestinationVirtualFile3) every { mockedTargetFile2.name } returns "test_mf_folder" every { mockedTargetFile2.children } returns arrayOf(childDestinationVirtualFile2) every { mockedStructureTreeModelNodeTarget.userObject } returns mockedNodeTarget @@ -856,11 +868,16 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ } returns mutableListOf(Pair(mockedTargetFile1, mockedSourceFile1), Pair(mockedTargetFile1, mockedSourceFile2), Pair(mockedTargetFile1, mockedSourceFile3), Pair(mockedTargetFile1, mockedSourceFile4), Pair(mockedTargetFile1, mockedSourceFile5), Pair(mockedTargetFile1, mockedSourceFile6), - Pair(mockedTargetFile2, mockedSourceFile1), Pair(mockedTargetFile2, mockedSourceFile2), Pair(mockedTargetFile2, mockedSourceFile3) + Pair(mockedTargetFile2, mockedSourceFile1), Pair(mockedTargetFile2, mockedSourceFile2), Pair(mockedTargetFile2, mockedSourceFile3), + Pair(mockedTargetFile3, mockedSourceFile2) ) + every { mockedTargetFile1.findChild(any() as String) } returns childDestinationVirtualFile1 + every { mockedTargetFile3.findChild(any() as String) } returns childDestinationVirtualFile3 + every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile1) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile2) } returns childDestMFFile2Attr + every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile3) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile1) } returns mockedSourceAttributes1 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile2) } returns mockedSourceAttributes2 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile3) } returns mockedSourceAttributes3 @@ -869,6 +886,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile6) } returns mockedSourceAttributes6 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile1) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile2) } returns mockedTargetFile2Attributes + every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile3) } returns null every { mockedDataContext.getData(IS_DRAG_AND_DROP_KEY) } returns true every { mockedDataContext.getData(CommonDataKeys.PROJECT) } returns mockedProject diff --git a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt index b5f2a0598..8be908806 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt @@ -30,9 +30,10 @@ import javax.swing.JComponent import javax.swing.JTextField open class TestFileEditorManager : FileEditorManager() { - override fun getComposite(file: VirtualFile): FileEditorComposite? { - TODO("Not yet implemented") - } +// TODO: needed in 1.*.*-223 and greater +// override fun getComposite(file: VirtualFile): FileEditorComposite? { +// TODO("Not yet implemented") +// } override fun openFile(file: VirtualFile, focusEditor: Boolean): Array { TODO("Not yet implemented") From 8a84c16b484f81385848733f4ef62d6a0b62c8d1 Mon Sep 17 00:00:00 2001 From: Arseni Tsikhamirau Date: Wed, 24 May 2023 11:41:18 +0200 Subject: [PATCH 08/22] IJMP-1140-Fix-ExplorerPasteProvider-tests-223 1) fixed tests + return back code for supporting IDEA version 223 --- .../ui/ExplorerPasteProviderTestSpec.kt | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt index f6ccb257d..127c52cd3 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerPasteProviderTestSpec.kt @@ -99,11 +99,11 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ every { mockedCopyPasterProvider.getSourceFilesFromClipboard() } returns mockedClipboardBuffer every { mockedFileExplorerView.isCut } returns AtomicBoolean(true) - every { mockedFileExplorerView.ignoreVFileDeleteEvents } returns AtomicBoolean(false) + every { mockedFileExplorerView.ignoreVFSChangeEvents } returns AtomicBoolean(false) every { mockedFileExplorerView.copyPasteSupport } returns mockedCopyPasterProvider mockkObject(FileExplorerContentProvider) - mockkObject(FileExplorerContentProvider::getInstance) + //mockkObject(FileExplorerContentProvider::getInstance) every { FileExplorerContentProvider.getInstance().getExplorerView(any() as Project) } returns mockedFileExplorerView var isPastePerformed : Boolean @@ -538,6 +538,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ ) } returns mutableListOf(Pair(mockedSourceFile, mockedSourceFile)) + every { mockedSourceFile.findChild(any() as String) } returns null mockedExplorerPasteProvider.performPaste(mockedDataContext) assertSoftly { @@ -728,6 +729,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile1 = mockk() val mockedSourceAttributes1 = mockk() every { mockedSourceFile1.name } returns "test1" + every { mockedSourceFile1.isDirectory } returns false every { mockedSourceAttributes1.isPastePossible } returns false every { mockedSourceAttributes1.isDirectory } returns false every { mockedSourceNodeData1.node } returns mockedSourceNode1 @@ -740,6 +742,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile2 = mockk() val mockedSourceAttributes2 = mockk() every { mockedSourceFile2.name } returns "test2" + every { mockedSourceFile2.isDirectory } returns true every { mockedSourceAttributes2.isPastePossible } returns false every { mockedSourceAttributes2.isDirectory } returns false every { mockedSourceNodeData2.node } returns mockedSourceNode2 @@ -752,6 +755,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile3 = mockk() val mockedSourceAttributes3 = mockk() every { mockedSourceFile3.name } returns "test1" + every { mockedSourceFile3.isDirectory } returns false every { mockedSourceAttributes3.isPastePossible } returns false every { mockedSourceAttributes3.isDirectory } returns false every { mockedSourceNodeData3.node } returns mockedSourceNode3 @@ -788,8 +792,9 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ val mockedSourceFile6 = mockk() val mockedSourceAttributes6 = mockk() every { mockedSourceFile6.name } returns "test1" + every { mockedSourceFile6.isDirectory } returns true every { mockedSourceAttributes6.isPastePossible } returns false - every { mockedSourceAttributes6.isDirectory } returns false + every { mockedSourceAttributes6.isDirectory } returns true every { mockedSourceNodeData6.node } returns mockedSourceNode6 every { mockedSourceNodeData6.file } returns mockedSourceFile6 every { mockedSourceNodeData6.attributes } returns mockedSourceAttributes6 @@ -797,18 +802,25 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ // children of target val childDestinationVirtualFile1 = mockk() every { childDestinationVirtualFile1.name } returns "test1" + every { childDestinationVirtualFile1.isDirectory } returns true val childDestinationVirtualFile2 = mockk() every { childDestinationVirtualFile2.name } returns "test_mf_file" val childDestMFFile2Attr = mockk() + val childDestinationVirtualFile3 = mockk() + every { childDestinationVirtualFile3.name } returns "test2" + every { childDestinationVirtualFile3.isDirectory } returns false // target to paste val mockedTargetFile1 = mockk() val mockedTargetFile2 = mockk() + val mockedTargetFile3 = mockk() val mockedTargetFile2Attributes = mockk() val mockedStructureTreeModelNodeTarget = mockk() val mockedNodeTarget = mockk() every { mockedTargetFile1.name } returns "test_folder" every { mockedTargetFile1.children } returns arrayOf(childDestinationVirtualFile1) + every { mockedTargetFile3.name } returns "test_folder2" + every { mockedTargetFile3.children } returns arrayOf(childDestinationVirtualFile3) every { mockedTargetFile2.name } returns "test_mf_folder" every { mockedTargetFile2.children } returns arrayOf(childDestinationVirtualFile2) every { mockedStructureTreeModelNodeTarget.userObject } returns mockedNodeTarget @@ -856,11 +868,16 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ } returns mutableListOf(Pair(mockedTargetFile1, mockedSourceFile1), Pair(mockedTargetFile1, mockedSourceFile2), Pair(mockedTargetFile1, mockedSourceFile3), Pair(mockedTargetFile1, mockedSourceFile4), Pair(mockedTargetFile1, mockedSourceFile5), Pair(mockedTargetFile1, mockedSourceFile6), - Pair(mockedTargetFile2, mockedSourceFile1), Pair(mockedTargetFile2, mockedSourceFile2), Pair(mockedTargetFile2, mockedSourceFile3) + Pair(mockedTargetFile2, mockedSourceFile1), Pair(mockedTargetFile2, mockedSourceFile2), Pair(mockedTargetFile2, mockedSourceFile3), + Pair(mockedTargetFile3, mockedSourceFile2) ) + every { mockedTargetFile1.findChild(any() as String) } returns childDestinationVirtualFile1 + every { mockedTargetFile3.findChild(any() as String) } returns childDestinationVirtualFile3 + every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile1) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile2) } returns childDestMFFile2Attr + every { dataOpsManagerService.testInstance.tryToGetAttributes(childDestinationVirtualFile3) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile1) } returns mockedSourceAttributes1 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile2) } returns mockedSourceAttributes2 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile3) } returns mockedSourceAttributes3 @@ -869,6 +886,7 @@ class ExplorerPasteProviderTestSpec : ShouldSpec({ every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedSourceFile6) } returns mockedSourceAttributes6 every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile1) } returns null every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile2) } returns mockedTargetFile2Attributes + every { dataOpsManagerService.testInstance.tryToGetAttributes(mockedTargetFile3) } returns null every { mockedDataContext.getData(IS_DRAG_AND_DROP_KEY) } returns true every { mockedDataContext.getData(CommonDataKeys.PROJECT) } returns mockedProject From 963ede362e07f842c12e7813cff2e5a4aaa9a3b1 Mon Sep 17 00:00:00 2001 From: Dzianis Lisiankou Date: Wed, 24 May 2023 15:45:06 +0300 Subject: [PATCH 09/22] IJMP-896: fix tooltip --- .../ibagroup/formainframe/explorer/ui/FilesWorkingSetNode.kt | 2 ++ .../kotlin/eu/ibagroup/formainframe/explorer/ui/JesWsNode.kt | 2 ++ .../eu/ibagroup/formainframe/explorer/ui/WorkingSetNode.kt | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FilesWorkingSetNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FilesWorkingSetNode.kt index 66d6df26e..da7eb9b78 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FilesWorkingSetNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FilesWorkingSetNode.kt @@ -30,6 +30,8 @@ class FilesWorkingSetNode( private val valueForFilesWS = value as FilesWorkingSet + override val regularTooltip = "Files Working Set" + override fun update(presentation: PresentationData) { presentation.addText(valueForFilesWS.name, SimpleTextAttributes.REGULAR_ATTRIBUTES) when { diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/JesWsNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/JesWsNode.kt index 19562be14..55df30918 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/JesWsNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/JesWsNode.kt @@ -29,6 +29,8 @@ class JesWsNode( workingSet, project, parent, treeStructure ), MFNode, RefreshableNode { + override val regularTooltip = "JES Working Set" + override fun update(presentation: PresentationData) { presentation.addText(value.name, SimpleTextAttributes.REGULAR_ATTRIBUTES) when { diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/WorkingSetNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/WorkingSetNode.kt index e36e06619..163bda6f0 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/WorkingSetNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/WorkingSetNode.kt @@ -37,6 +37,8 @@ abstract class WorkingSetNode( ), MFNode, RefreshableNode { protected var cachedChildrenInternal: MutableCollection>? = null + abstract val regularTooltip: String + val cachedChildren: MutableCollection> get() = cachedChildrenInternal ?: mutableListOf() @@ -50,7 +52,7 @@ abstract class WorkingSetNode( */ protected fun regular(presentation: PresentationData) { presentation.setIcon(regularIcon) - presentation.tooltip = "Working set" + presentation.tooltip = regularTooltip } /** From 60ca4dc1c3777dad83699fcc49a14875d30a3907 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Fri, 26 May 2023 11:42:09 +0200 Subject: [PATCH 10/22] Removed v1.0.2-221 not needed functionality --- .../formainframe/editor/MFPastePreprocessor.kt | 18 ------------------ .../explorer/actions/AddMemberAction.kt | 1 - .../explorer/actions/AllocateDatasetAction.kt | 1 - .../actions/ChangeContentModeAction.kt | 1 - .../explorer/actions/CreateUssEntityAction.kt | 1 - .../explorer/actions/PurgeJobAction.kt | 1 - .../explorer/actions/RenameAction.kt | 1 - .../explorer/ui/ExplorerTreeNode.kt | 1 - .../explorer/ui/FileExplorerView.kt | 1 - .../explorer/ui/FileLikeDatasetNode.kt | 1 - 10 files changed, 27 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt index c69f201e1..d4439aca9 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/MFPastePreprocessor.kt @@ -43,24 +43,6 @@ class MFPastePreprocessor : CopyPastePostProcessor() return DATA_FLAVOR } - // This function is not needed to be overridden since v1.*.*-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun getOffsetCount(): Int { - return 0 - } - - // This function is not needed to be overridden since v1.*.*-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun getOffsets(offsets: IntArray?, index: Int): Int { - return index - } - - // This function is not needed to be overridden since v1.*.*-223 - @ApiStatus.ScheduledForRemoval(inVersion = "2.0.0") - override fun setOffsets(offsets: IntArray?, index: Int): Int { - return index - } - companion object { private val DATA_FLAVOR = DataFlavor(MFPastePreprocessor::class.java, "class: ChangeContentByPasteAction") } 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 4d3d0615e..920c8557e 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AddMemberAction.kt @@ -26,7 +26,6 @@ import eu.ibagroup.formainframe.dataops.getAttributesService import eu.ibagroup.formainframe.dataops.operations.* import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.explorer.ui.* -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile /** Class that represents "Add member" action */ diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt index d102bf3ed..f5a0e2308 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateDatasetAction.kt @@ -37,7 +37,6 @@ import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.castOrNull import eu.ibagroup.formainframe.utils.clone import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.r2z.* /** diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt index 24f8494b3..0bb24ff65 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/ChangeContentModeAction.kt @@ -20,7 +20,6 @@ import eu.ibagroup.formainframe.dataops.attributes.* import eu.ibagroup.formainframe.explorer.ui.FILE_EXPLORER_VIEW import eu.ibagroup.formainframe.explorer.ui.FileExplorerView import eu.ibagroup.formainframe.utils.sendTopic -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import eu.ibagroup.r2z.XIBMDataType 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 21d5385b0..6efee375c 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/CreateUssEntityAction.kt @@ -32,7 +32,6 @@ import eu.ibagroup.formainframe.dataops.operations.UssChangeModeOperation import eu.ibagroup.formainframe.dataops.operations.UssChangeModeParams import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.castOrNull -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import eu.ibagroup.r2z.ChangeMode import eu.ibagroup.r2z.FileType 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 7846ad939..f6f7598e1 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/PurgeJobAction.kt @@ -15,7 +15,6 @@ import eu.ibagroup.formainframe.dataops.operations.jobs.PurgeJobOperation import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.ui.build.jobs.JOBS_LOG_VIEW import eu.ibagroup.formainframe.ui.build.jobs.JobBuildTreeView -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.r2z.ExecData import eu.ibagroup.r2z.JESApi import eu.ibagroup.r2z.Job 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 c492ce51d..8b483f602 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/RenameAction.kt @@ -32,7 +32,6 @@ import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.explorer.ui.* import eu.ibagroup.formainframe.utils.clone import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater /** * Class which represents a rename action diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt index 59237ac90..73fe0cc78 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/ExplorerTreeNode.kt @@ -34,7 +34,6 @@ import eu.ibagroup.formainframe.explorer.Explorer import eu.ibagroup.formainframe.explorer.UIComponentManager import eu.ibagroup.formainframe.utils.isBeingEditingNow import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import javax.swing.tree.TreePath 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 a9d5fad81..900d8142b 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileExplorerView.kt @@ -40,7 +40,6 @@ import eu.ibagroup.formainframe.explorer.Explorer import eu.ibagroup.formainframe.explorer.FilesWorkingSet import eu.ibagroup.formainframe.utils.getMinimalCommonParents import eu.ibagroup.formainframe.utils.getParentsChain -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import java.awt.Toolkit import java.awt.datatransfer.DataFlavor diff --git a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt index 97e02ba2a..deef63ca3 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/ui/FileLikeDatasetNode.kt @@ -24,7 +24,6 @@ import eu.ibagroup.formainframe.dataops.attributes.RemoteDatasetAttributes import eu.ibagroup.formainframe.dataops.attributes.RemoteMemberAttributes import eu.ibagroup.formainframe.dataops.getAttributesService import eu.ibagroup.formainframe.explorer.ExplorerUnit -import eu.ibagroup.formainframe.utils.service // TODO: remove in v1.*.*-223 and greater import eu.ibagroup.formainframe.vfs.MFVirtualFile import icons.ForMainframeIcons From d3e225490cb2f364389143ffa14379c7e6a432a4 Mon Sep 17 00:00:00 2001 From: Dzianis Lisiankou Date: Wed, 14 Jun 2023 17:24:07 +0300 Subject: [PATCH 11/22] Fixes after 'Merge branch release/v1.1.0-221 into release/v1.1.0-223' --- .../formainframe/config/ConfigSandboxImpl.kt | 1 - .../config/ws/ui/AbstractWsDialog.kt | 1 - .../fetch/RemoteFileFetchProviderBase.kt | 1 - .../editor/FileEditorFocusListener.kt | 2 +- .../formainframe/utils/encodingUtils.kt | 4 ++-- .../eu/ibagroup/formainframe/utils/miscUtils.kt | 17 ----------------- src/main/resources/META-INF/plugin.xml | 3 +-- .../formainframe/editor/EditorTestSpec.kt | 2 +- .../formainframe/explorer/ui/dummyClasses.kt | 7 +++---- 9 files changed, 8 insertions(+), 30 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt index 4b19c81a5..e321e476a 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt @@ -20,7 +20,6 @@ import eu.ibagroup.formainframe.utils.crudable.EntityWithUuid import eu.ibagroup.formainframe.utils.crudable.ReloadableEventHandler import eu.ibagroup.formainframe.utils.isThe import eu.ibagroup.formainframe.utils.isTheSameAs -import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** Stateful class to represent the plugin configs sandbox */ data class SandboxState( diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt index 6e914f89d..bfbfca956 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt @@ -32,7 +32,6 @@ import eu.ibagroup.formainframe.utils.validateForBlank import eu.ibagroup.formainframe.utils.validateWorkingSetName import java.awt.Dimension import javax.swing.JComponent -import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** * Abstract class for displaying configuration dialog of single Working Set. diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt index 3588970e1..4f1aa499f 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt @@ -27,7 +27,6 @@ import eu.ibagroup.formainframe.utils.sendTopic import java.util.concurrent.locks.ReentrantLock import kotlin.collections.set import kotlin.concurrent.withLock -import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** * Abstract class that represents a base fetch provider for fetching remote files. diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorFocusListener.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorFocusListener.kt index f44e96821..b9b18510d 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorFocusListener.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorFocusListener.kt @@ -14,7 +14,7 @@ import com.intellij.openapi.components.service import com.intellij.openapi.editor.Editor import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.editor.ex.FocusChangeListener -// import com.intellij.openapi.ui.isComponentUnderMouse // TODO: needed in v1.*.*-223 and greater +import com.intellij.openapi.ui.isComponentUnderMouse import eu.ibagroup.formainframe.config.ConfigService import eu.ibagroup.formainframe.dataops.DataOpsManager import eu.ibagroup.formainframe.dataops.content.synchronizer.AutoSyncFileListener diff --git a/src/main/kotlin/eu/ibagroup/formainframe/utils/encodingUtils.kt b/src/main/kotlin/eu/ibagroup/formainframe/utils/encodingUtils.kt index ada13d1a9..6b3be9d5a 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/utils/encodingUtils.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/utils/encodingUtils.kt @@ -15,6 +15,7 @@ import com.intellij.codeInspection.InspectionEngine import com.intellij.codeInspection.InspectionManager import com.intellij.icons.AllIcons import com.intellij.ide.IdeBundle +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DefaultActionGroup import com.intellij.openapi.fileEditor.FileDocumentManager @@ -178,8 +179,7 @@ fun createCharsetsActionGroup(virtualFile: VirtualFile, attributes: RemoteUssAtt super.update(e) } - // TODO: needed in v1.*.*-223 and greater - // override fun getActionUpdateThread() = ActionUpdateThread.BGT + override fun getActionUpdateThread() = ActionUpdateThread.BGT } } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt index e7e595b4d..81371961b 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt @@ -14,18 +14,13 @@ import com.google.gson.Gson import com.intellij.util.containers.minimalElements import com.intellij.util.containers.toArray import eu.ibagroup.formainframe.config.ConfigDeclaration -import java.awt.Component -import java.awt.MouseInfo -import java.awt.Rectangle import java.util.* import java.util.concurrent.locks.Lock import java.util.concurrent.locks.ReadWriteLock import java.util.stream.Stream import java.util.stream.StreamSupport -import javax.swing.SwingUtilities import kotlin.concurrent.thread import kotlin.concurrent.withLock -import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater /** @@ -265,15 +260,3 @@ fun debounce(delayInterval: Long, block: () -> Unit): () -> Unit { } } } - -// TODO: remove in v1.*.*-223 and greater -fun Component.isComponentUnderMouse(): Boolean { - if (mousePosition != null) { - return true - } - val pointerInfo = MouseInfo.getPointerInfo() ?: return false - val location = pointerInfo.location - SwingUtilities.convertPointFromScreen(location, this) - val bounds = Rectangle(0, 0, width, height) - return bounds.contains(location) -} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 7fb1149fc..2b684835b 100755 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -378,10 +378,9 @@ Example of how to see the output:
implementation="eu.ibagroup.formainframe.editor.status.MfEncodingPanelWidgetFactory" order="after eu.ibagroup.formainframe.editor.status.MfLineSeparatorWidgetFactory, before powerStatus"/> - diff --git a/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt index d61366cdd..7a7f2ab2b 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt @@ -19,7 +19,7 @@ import com.intellij.openapi.components.ComponentManager import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.fileEditor.impl.LoadTextUtil import com.intellij.openapi.project.Project -// import com.intellij.openapi.ui.isComponentUnderMouse // TODO: needed in v1.*.*-223 and greater +import com.intellij.openapi.ui.isComponentUnderMouse import com.intellij.openapi.util.Ref import com.intellij.openapi.util.TextRange import com.intellij.openapi.util.text.StringUtil diff --git a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt index 8be908806..b5f2a0598 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt @@ -30,10 +30,9 @@ import javax.swing.JComponent import javax.swing.JTextField open class TestFileEditorManager : FileEditorManager() { -// TODO: needed in 1.*.*-223 and greater -// override fun getComposite(file: VirtualFile): FileEditorComposite? { -// TODO("Not yet implemented") -// } + override fun getComposite(file: VirtualFile): FileEditorComposite? { + TODO("Not yet implemented") + } override fun openFile(file: VirtualFile, focusEditor: Boolean): Array { TODO("Not yet implemented") From 0046ae24bc3f7d4689bb36ab1139d3ab3e1c0ff7 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Fri, 16 Jun 2023 18:51:40 +0200 Subject: [PATCH 12/22] Fixes after merge with 221 --- .../ibagroup/formainframe/config/ConfigSandboxImpl.kt | 11 ++--------- .../formainframe/config/ws/ui/AbstractWsDialog.kt | 8 +------- .../dataops/fetch/RemoteFileFetchProviderBase.kt | 8 +------- .../formainframe/ui/build/tso/ui/TSOSessionDialog.kt | 10 ++-------- .../eu/ibagroup/formainframe/utils/miscUtils.kt | 6 +----- 5 files changed, 7 insertions(+), 36 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt index 65eb5541d..4f55ae790 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt @@ -20,8 +20,6 @@ import eu.ibagroup.formainframe.utils.crudable.EntityWithUuid import eu.ibagroup.formainframe.utils.crudable.ReloadableEventHandler import eu.ibagroup.formainframe.utils.isThe import eu.ibagroup.formainframe.utils.isTheSameAs -import java.util.stream.Collectors - /** Stateful class to represent the plugin configs sandbox */ data class SandboxState( @@ -212,10 +210,7 @@ class ConfigSandboxImpl : ConfigSandbox { service() .getRegisteredConfigDeclarations() .filter { it.useCredentials } - // TODO: remove in v1.*.*-223 and greater - .flatMap { configCrudable.getAll(it.clazz).collect(Collectors.toList()) } - // TODO: use in v1.*.*-223 and greater -// .flatMap { configCrudable.getAll(it.clazz).toList() } + .flatMap { configCrudable.getAll(it.clazz).toList() } .filterIsInstance() .map { with(CredentialService.instance) { @@ -223,10 +218,8 @@ class ConfigSandboxImpl : ConfigSandbox { } } } else { - // TODO: remove in v1.*.*-223 and greater configCrudable.getAll(clazz).collect(Collectors.toList()) - // TODO: use in v1.*.*-223 and greater -// configCrudable.getAll(clazz).toList() + configCrudable.getAll(clazz).toList() } listOfNotNull(classToList(clazz, state), classToList(clazz, initialState)) .forEach { list -> diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt index b778319b0..e36da7251 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ws/ui/AbstractWsDialog.kt @@ -31,7 +31,6 @@ import eu.ibagroup.formainframe.utils.nullable import eu.ibagroup.formainframe.utils.validateForBlank import eu.ibagroup.formainframe.utils.validateWorkingSetName import java.awt.Dimension -import java.util.stream.Collectors import javax.swing.JComponent /** @@ -57,12 +56,7 @@ abstract class AbstractWsDialog abstract val connectionClass: Class - // TODO: remove in v1.*.*-223 and greater - private val connectionComboBoxModel by lazy { - CollectionComboBoxModel(crudable.getAll(connectionClass).collect(Collectors.toList())) - } - // TODO: use in v1.*.*-223 and greater -// private val connectionComboBoxModel by lazy { CollectionComboBoxModel(crudable.getAll(connectionClass).toList()) } + private val connectionComboBoxModel by lazy { CollectionComboBoxModel(crudable.getAll(connectionClass).toList()) } /** * Name of masks table. diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt index b4e5dea07..4f1aa499f 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/fetch/RemoteFileFetchProviderBase.kt @@ -25,12 +25,9 @@ import eu.ibagroup.formainframe.utils.runIfTrue import eu.ibagroup.formainframe.utils.runWriteActionOnWriteThread import eu.ibagroup.formainframe.utils.sendTopic import java.util.concurrent.locks.ReentrantLock -import java.util.stream.Collectors import kotlin.collections.set import kotlin.concurrent.withLock -//import kotlin.streams.toList // TODO: remove in v1.*.*-223 and greater - /** * Abstract class that represents a base fetch provider for fetching remote files. * @param dataOpsManager instance of DataOpsManager service. @@ -175,10 +172,7 @@ abstract class RemoteFileFetchProviderBase - // TODO: remove in v1.*.*-223 and greater - private var connectionComboBoxModel = - CollectionComboBoxModel(configCrudable.getAll().collect(Collectors.toList())) - - // TODO: use in v1.*.*-223 and greater -// private var connectionComboBoxModel = CollectionComboBoxModel(configCrudable.getAll().toList()) + private var connectionComboBoxModel = CollectionComboBoxModel(configCrudable.getAll().toList()) private var codepageComboBoxModel = CollectionComboBoxModel(TsoCodePage.values().toList()) /** @@ -238,4 +232,4 @@ data class TSOSessionParams( var acct: String = "ACCT#", var usergroup: String = "GROUP1", var region: String = "64000" -) \ No newline at end of file +) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt index e611e8914..b70de4e90 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/utils/miscUtils.kt @@ -17,7 +17,6 @@ import eu.ibagroup.formainframe.config.ConfigDeclaration import java.util.* import java.util.concurrent.locks.Lock import java.util.concurrent.locks.ReadWriteLock -import java.util.stream.Collectors import java.util.stream.Stream import java.util.stream.StreamSupport import kotlin.concurrent.thread @@ -38,10 +37,7 @@ fun loadConfigClass(className: String): Class<*>? { /** Transform the stream to the mutable list */ fun Stream.toMutableList(): MutableList { - // TODO: remove in v1.*.*-223 and greater - return this.collect(Collectors.toList()).toMutableList() - // TODO: use in v1.*.*-223 and greater -// return this.toList().toMutableList() + return this.toList().toMutableList() } /** Transform the value to the specified class or return null if the cast is not possible */ From 02a4db0d57e7770c16d498376ca536419be6af1d Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Tue, 20 Jun 2023 19:00:04 +0200 Subject: [PATCH 13/22] Small fix after v1.1.0-221 --- .../kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt index 4f55ae790..e321e476a 100755 --- a/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/config/ConfigSandboxImpl.kt @@ -218,7 +218,6 @@ class ConfigSandboxImpl : ConfigSandbox { } } } else { - configCrudable.getAll(clazz).collect(Collectors.toList()) configCrudable.getAll(clazz).toList() } listOfNotNull(classToList(clazz, state), classToList(clazz, initialState)) From a25972414e7efc94be400456659901160ed39e8d Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Thu, 22 Jun 2023 13:15:06 +0200 Subject: [PATCH 14/22] IJMP-1153 Fix for 223 --- Jenkinsfile.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index 749490460..1930a25b1 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -37,7 +37,7 @@ pipeline { } tools { gradle 'Default' - jdk 'Java 11' + jdk 'Java 17' } stages { stage('Initial checkup') { From df523764730c774751c9ec55540d16c1faec7878 Mon Sep 17 00:00:00 2001 From: Arseni Tsikhamirau Date: Tue, 1 Aug 2023 11:31:35 +0200 Subject: [PATCH 15/22] IJMP-1233-Sync-is-not-working-during-indexing 1) changed to support IDEA version 223 --- .../content/synchronizer/SyncAction.kt | 17 ++-- .../synchronizer/SyncToolbarProvider.kt | 33 ++++++- .../editor/ChangeContentServiceImpl.kt | 7 +- .../eu/ibagroup/formainframe/editor/utils.kt | 19 ++++ src/main/resources/META-INF/plugin.xml | 3 + .../dataops/SyncToolbarProviderTestSpec.kt | 84 +++++++++++++++++ .../editor/EditorUtilsTestSpec.kt | 89 +++++++++++++++++++ 7 files changed, 243 insertions(+), 9 deletions(-) create mode 100644 src/test/kotlin/eu/ibagroup/formainframe/dataops/SyncToolbarProviderTestSpec.kt create mode 100644 src/test/kotlin/eu/ibagroup/formainframe/editor/EditorUtilsTestSpec.kt 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 eb44c6e2e..c5d473e66 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 @@ -13,17 +13,14 @@ package eu.ibagroup.formainframe.dataops.content.synchronizer import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.CommonDataKeys import com.intellij.openapi.components.service -import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.ex.EditorEx import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.progress.runBackgroundableTask 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.checkEncodingCompatibility -import eu.ibagroup.formainframe.utils.runReadActionInEdtAndWait -import eu.ibagroup.formainframe.utils.runWriteActionInEdtAndWait -import eu.ibagroup.formainframe.utils.showSaveAnywayDialog +import eu.ibagroup.formainframe.utils.* /** Sync action event. It will handle the manual sync button action when it is clicked */ class SyncAction : DumbAwareAction() { @@ -54,8 +51,8 @@ class SyncAction : DumbAwareAction() { * Get an editor on which the event was triggered * @param e the event to get the editor */ - private fun getEditor(e: AnActionEvent): Editor? { - return e.getData(CommonDataKeys.EDITOR) + private fun getEditor(e: AnActionEvent): EditorEx? { + return e.getData(CommonDataKeys.EDITOR).castOrNull() } /** @@ -110,4 +107,10 @@ class SyncAction : DumbAwareAction() { && needToUpload } + /** + * Determines if an action is dumb aware or not + */ + override fun isDumbAware(): Boolean { + return true + } } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncToolbarProvider.kt b/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncToolbarProvider.kt index db2bf6eb6..f3e125eb1 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncToolbarProvider.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/dataops/content/synchronizer/SyncToolbarProvider.kt @@ -10,14 +10,45 @@ package eu.ibagroup.formainframe.dataops.content.synchronizer +import com.intellij.openapi.actionSystem.ActionGroup +import com.intellij.openapi.actionSystem.ActionManager +import com.intellij.openapi.actionSystem.DefaultActionGroup +import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.editor.toolbar.floating.AbstractFloatingToolbarProvider +import com.intellij.openapi.project.Project +import com.intellij.openapi.startup.StartupActivity.RequiredForSmartMode private const val ACTION_GROUP = "eu.ibagroup.formainframe.dataops.content.synchronizer.SyncActionGroup" /** * Class which serves as extension point for editor floating toolbar provider. Defined in plugin.xml */ -class SyncToolbarProvider : AbstractFloatingToolbarProvider(ACTION_GROUP) { +class SyncToolbarProvider : AbstractFloatingToolbarProvider(ACTION_GROUP), RequiredForSmartMode { override val autoHideable = true override val priority = 1 + override val actionGroup: ActionGroup by lazy { + resolveActionGroup() + } + + /** + * Resolves Sync Action Toolbar during IDE startup activity + * @return resolved sync action + */ + private fun resolveActionGroup(): ActionGroup { + ApplicationManager.getApplication() + val actionManager = ActionManager.getInstance() + val action = actionManager.getAction(ACTION_GROUP) + if (action is ActionGroup) return action + val defaultActionGroup = DefaultActionGroup() + actionManager.registerAction(ACTION_GROUP, defaultActionGroup) + return defaultActionGroup + } + + /** + * Runs an activity during IDE startup + * @param project - current project + */ + override fun runActivity(project: Project) { + resolveActionGroup() + } } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt index 0fcb104e0..99ec123ab 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt @@ -15,6 +15,7 @@ import com.intellij.openapi.actionSystem.ex.AnActionListener import com.intellij.openapi.command.CommandProcessor import com.intellij.openapi.components.service import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.ReadOnlyModificationException import com.intellij.openapi.fileEditor.FileDocumentManager import eu.ibagroup.formainframe.dataops.DataOpsManager import eu.ibagroup.formainframe.dataops.content.adapters.MFContentAdapter @@ -72,7 +73,11 @@ class ChangeContentServiceImpl : ChangeContentService { val adaptedContent = contentAdapter.prepareContentToMainframe(currentContent, file) runWriteActionInEdt { CommandProcessor.getInstance().runUndoTransparentAction { - editor.document.setText(adaptedContent) + try { + editor.document.setText(adaptedContent) + } catch (e: ReadOnlyModificationException) { + return@runUndoTransparentAction + } } } } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/utils.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/utils.kt index b35d12e19..d7a13be51 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/utils.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/utils.kt @@ -11,7 +11,10 @@ package eu.ibagroup.formainframe.editor import com.intellij.ide.plugins.PluginManager +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.EditorModificationUtil import com.intellij.openapi.extensions.PluginId +import com.intellij.openapi.fileEditor.FileDocumentManager import com.intellij.openapi.project.Project import com.intellij.openapi.ui.MessageDialogBuilder import com.intellij.openapi.util.Key @@ -70,4 +73,20 @@ fun VirtualFile.isMfVirtualFile(): Boolean { */ fun VirtualFile.isUssVirtualFile(): Boolean { return this.get()?.keys?.find { it.toString() == USS_VIRTUAL_FILE_KEY_NAME } != null +} + +/** + * Function checks the current editor status for the opened document and returns true if document is writable, false otherwise. + * If document is read-only shows the information hint on the TOP of the current caret position + * @param editor - current opened file editor + */ +fun requestDocumentWriting(editor: Editor): Boolean { + val writeAccess = FileDocumentManager.getInstance().requestWritingStatus(editor.document, editor.project) + if (!writeAccess.hasWriteAccess()) { + EditorModificationUtil.setReadOnlyHint(editor, "File is read-only while indexing is in progress.").apply { + EditorModificationUtil.checkModificationAllowed(editor) + } + return false + } + return true } \ No newline at end of file diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index f3791b1f3..c1b3feff9 100755 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -299,6 +299,9 @@ Example of how to see the output:
displayName="For Mainframe" provider="eu.ibagroup.formainframe.config.MainframeConfigurableProvider"/> + + diff --git a/src/test/kotlin/eu/ibagroup/formainframe/dataops/SyncToolbarProviderTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/dataops/SyncToolbarProviderTestSpec.kt new file mode 100644 index 000000000..cc660e65b --- /dev/null +++ b/src/test/kotlin/eu/ibagroup/formainframe/dataops/SyncToolbarProviderTestSpec.kt @@ -0,0 +1,84 @@ +/* + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright IBA Group 2020 + */ + +package eu.ibagroup.formainframe.dataops + +import com.intellij.openapi.actionSystem.ActionGroup +import com.intellij.openapi.actionSystem.ActionManager +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.DefaultActionGroup +import com.intellij.openapi.project.Project +import com.intellij.testFramework.LightProjectDescriptor +import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory +import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl +import eu.ibagroup.formainframe.dataops.content.synchronizer.SyncToolbarProvider +import io.kotest.assertions.assertSoftly +import io.kotest.core.spec.style.ShouldSpec +import io.kotest.matchers.shouldBe +import io.mockk.* + +class SyncToolbarProviderTestSpec : ShouldSpec({ + beforeSpec { + // FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE + val factory = IdeaTestFixtureFactory.getFixtureFactory() + val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR + val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe") + val fixture = fixtureBuilder.fixture + val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture( + fixture, + LightTempDirTestFixtureImpl(true) + ) + myFixture.setUp() + } + afterSpec { + clearAllMocks() + } + + context("sync action toolbar") { + + val mockedProject = mockk() + val mockedActionManagerInstance = mockk() + val syncToolbarProviderForTest = spyk(SyncToolbarProvider()) + mockkStatic(ActionManager::getInstance) + + should("run activity and resolve action group toolbar when action group is not null") { + var isResolved = false + val mockedActionGroupForTest = mockk() + every { ActionManager.getInstance() } returns mockedActionManagerInstance + every { mockedActionManagerInstance.getAction(any() as String)} answers { + isResolved = true + mockedActionGroupForTest + } + syncToolbarProviderForTest.runActivity(mockedProject) + + assertSoftly { + isResolved shouldBe true + } + } + + should("run activity and resolve action group toolbar when action group is simple action") { + var isResolved = false + val mockedNotActionGroupForTest = mockk() + every { ActionManager.getInstance() } returns mockedActionManagerInstance + every { mockedActionManagerInstance.getAction(any() as String)} returns mockedNotActionGroupForTest + every { mockedActionManagerInstance.registerAction(any() as String, any() as DefaultActionGroup) } answers { + isResolved = true + } + + syncToolbarProviderForTest.runActivity(mockedProject) + + assertSoftly { + isResolved shouldBe true + } + } + + unmockkAll() + } +}) \ No newline at end of file diff --git a/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorUtilsTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorUtilsTestSpec.kt new file mode 100644 index 000000000..4dbb166a9 --- /dev/null +++ b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorUtilsTestSpec.kt @@ -0,0 +1,89 @@ +/* + * This program and the accompanying materials are made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-v20.html + * + * SPDX-License-Identifier: EPL-2.0 + * + * Copyright IBA Group 2020 + */ + +package eu.ibagroup.formainframe.editor + +import com.intellij.openapi.editor.Document +import com.intellij.openapi.editor.Editor +import com.intellij.openapi.editor.EditorModificationUtil +import com.intellij.openapi.fileEditor.FileDocumentManager +import com.intellij.openapi.project.Project +import com.intellij.testFramework.LightProjectDescriptor +import com.intellij.testFramework.fixtures.IdeaTestFixtureFactory +import com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl +import io.kotest.assertions.assertSoftly +import io.kotest.core.spec.style.ShouldSpec +import io.kotest.matchers.shouldBe +import io.mockk.* + +class EditorUtilsTestSpec : ShouldSpec({ + beforeSpec { + // FIXTURE SETUP TO HAVE ACCESS TO APPLICATION INSTANCE + val factory = IdeaTestFixtureFactory.getFixtureFactory() + val projectDescriptor = LightProjectDescriptor.EMPTY_PROJECT_DESCRIPTOR + val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "for-mainframe") + val fixture = fixtureBuilder.fixture + val myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture( + fixture, + LightTempDirTestFixtureImpl(true) + ) + myFixture.setUp() + } + afterSpec { + clearAllMocks() + } + + context("Utils common test spec") { + + val editorMock = mockk() + val documentMock = mockk() + val projectMock = mockk() + every { editorMock.document } returns documentMock + every { editorMock.project } returns projectMock + mockkStatic(FileDocumentManager::getInstance) + mockkStatic(EditorModificationUtil::checkModificationAllowed) + + should("requestDocumentWriting. Check if current document is writable") { + var isFileWritable = false + every { FileDocumentManager.getInstance().requestWritingStatus(documentMock, projectMock) } answers { + isFileWritable = true + FileDocumentManager.WriteAccessStatus.WRITABLE + } + + requestDocumentWriting(editorMock) + + assertSoftly { + isFileWritable shouldBe true + } + + } + + should("requestDocumentWriting. Check if current document is not writable") { + var isFileWritable = true + every { FileDocumentManager.getInstance().requestWritingStatus(documentMock, projectMock) } answers { + FileDocumentManager.WriteAccessStatus.NON_WRITABLE + } + every { EditorModificationUtil.setReadOnlyHint(editorMock, any() as String) } just Runs + every { EditorModificationUtil.checkModificationAllowed(editorMock) } answers { + isFileWritable = false + false + } + + requestDocumentWriting(editorMock) + + assertSoftly { + isFileWritable shouldBe false + } + + } + + unmockkAll() + } +}) \ No newline at end of file From 6ce5f6badb87426fd907adf3a1b31b882bc38f20 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Thu, 10 Aug 2023 13:26:50 +0200 Subject: [PATCH 16/22] Some fixes to 223 version --- .../content/synchronizer/SyncAction.kt | 10 ---------- .../editor/ChangeContentServiceImpl.kt | 20 +++---------------- .../editor/FileEditorEventsListener.kt | 16 ++------------- .../explorer/actions/AllocateActionBase.kt | 1 - 4 files changed, 5 insertions(+), 42 deletions(-) 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 243c25be4..13232933c 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 @@ -98,16 +98,6 @@ class SyncAction : DumbAwareAction() { } val editor = getEditor(e) ?: return - // TODO: remove in v1.*.*-223 and greater - val isDumbMode = ActionUtil.isDumbMode(e.project) - if (!isDumbMode && file.isWritable) { - editor.document.setReadOnly(false) - editor.isViewer = false - } else { - e.presentation.isEnabledAndVisible = false - return - } - val contentSynchronizer = service().getContentSynchronizer(file) val syncProvider = DocumentedSyncProvider(file) val currentContent = runReadActionInEdtAndWait { syncProvider.retrieveCurrentContent() } diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt index a57ea1eec..afd62a156 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/ChangeContentServiceImpl.kt @@ -49,28 +49,14 @@ class ChangeContentServiceImpl : ChangeContentService { if (action is EditorPasteAction || (action is PasteAction && event.place == "EditorPopup")) { val editor = event.getData(CommonDataKeys.EDITOR) ?: return - // TODO: remove below check in v1.*.*-223 and greater - val isFileWritable = requestDocumentWriting(editor) - if (isFileWritable) { - processMfContent(editor) - } - - // TODO: use in v1.*.*-223 and greater - //processMfContent(editor) + processMfContent(editor) } } override fun afterEditorTyping(c: Char, dataContext: DataContext) { val editor = dataContext.getData(CommonDataKeys.EDITOR) ?: return - // TODO: remove below check in v1.*.*-223 and greater - val isFileWritable = requestDocumentWriting(editor) - if (isFileWritable) { - processMfContent(editor) - } - - // TODO: use in v1.*.*-223 and greater - //processMfContent(editor) + processMfContent(editor) } } ) @@ -101,4 +87,4 @@ class ChangeContentServiceImpl : ChangeContentService { adaptContentFunc?.let { it() } } -} \ No newline at end of file +} diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt index 5cf6c0613..c74899c27 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt @@ -39,20 +39,8 @@ class FileEditorEventsListener : FileEditorManagerListener { override fun fileOpened(source: FileEditorManager, file: VirtualFile) { val editor = source.selectedTextEditor as? EditorEx - // TODO: remove in v1.*.*-223 and greater - if (editor != null) { - editor.addFocusListener(focusListener) - val isDumbMode = ActionUtil.isDumbMode(editor.project) - if (isDumbMode) { - editor.document.setReadOnly(true) - editor.isViewer = true - } - super.fileOpened(source, file) - } - - // TODO: use in v1.*.*-223 and greater - //editor?.addFocusListener(focusListener) - //super.fileOpened(source, file) + editor?.addFocusListener(focusListener) + super.fileOpened(source, file) } } 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 79fd503c7..064c21820 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateActionBase.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/AllocateActionBase.kt @@ -39,7 +39,6 @@ import eu.ibagroup.formainframe.explorer.ui.getExplorerView import eu.ibagroup.formainframe.utils.castOrNull import eu.ibagroup.formainframe.utils.clone import eu.ibagroup.formainframe.utils.crudable.getByUniqueKey -import eu.ibagroup.formainframe.utils.service import org.zowe.kotlinsdk.Dataset import org.zowe.kotlinsdk.DatasetOrganization import org.zowe.kotlinsdk.DsnameType From d0e505b1c97beae793fe0fef5ea3496e78001615 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Mon, 14 Aug 2023 18:47:14 +0200 Subject: [PATCH 17/22] Release/v1.1.0-223 ready --- .../kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt index e51d4ebac..51514c809 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/explorer/ui/dummyClasses.kt @@ -15,7 +15,7 @@ import com.intellij.openapi.editor.Caret import com.intellij.openapi.editor.Editor import com.intellij.openapi.fileEditor.EditorDataProvider import com.intellij.openapi.fileEditor.FileEditor -//import com.intellij.openapi.fileEditor.FileEditorComposite // TODO: needed in 1.*.*-223 and greater +import com.intellij.openapi.fileEditor.FileEditorComposite import com.intellij.openapi.fileEditor.FileEditorManager import com.intellij.openapi.fileEditor.FileEditorNavigatable import com.intellij.openapi.fileEditor.OpenFileDescriptor From d1ebcdc84536451b54d6f1fe0842df6c16b4cbe8 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Tue, 22 Aug 2023 16:03:16 +0200 Subject: [PATCH 18/22] Small fix --- .../kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt index bbcf23365..66c02b2c0 100644 --- a/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt +++ b/src/test/kotlin/eu/ibagroup/formainframe/editor/EditorTestSpec.kt @@ -47,7 +47,6 @@ import eu.ibagroup.formainframe.explorer.WorkingSet import eu.ibagroup.formainframe.testutils.WithApplicationShouldSpec import eu.ibagroup.formainframe.testutils.testServiceImpl.TestDataOpsManagerImpl import eu.ibagroup.formainframe.utils.checkEncodingCompatibility -import eu.ibagroup.formainframe.utils.isComponentUnderMouse import eu.ibagroup.formainframe.utils.sendTopic import eu.ibagroup.formainframe.utils.service import eu.ibagroup.formainframe.utils.showSaveAnywayDialog From b83dae31b1fb1fc21cb54b08b60991d11e817648 Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Mon, 27 Nov 2023 16:45:16 +0100 Subject: [PATCH 19/22] The plugin version update Signed-off-by: Uladzislau --- build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index bfb869966..aac1f5456 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,7 +22,7 @@ apply(plugin = "kotlin") apply(plugin = "org.jetbrains.intellij") group = "eu.ibagroup" -version = "1.1.1-223" +version = "1.1.2-223" val remoteRobotVersion = "0.11.19" val okHttp3Version = "4.10.0" val kotestVersion = "5.6.2" From 29dc1a96e6a914022ffc8342131851190bf842c1 Mon Sep 17 00:00:00 2001 From: Uladzislau Kalesnikau Date: Tue, 9 Jan 2024 12:04:55 +0100 Subject: [PATCH 20/22] Update SubmitJobToolbarAction.kt --- .../formainframe/explorer/actions/SubmitJobToolbarAction.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 3aaee1f0b..7bbf6c72a 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt @@ -53,7 +53,7 @@ class SubmitJobToolbarAction: AnAction() { ), progressIndicator = it ).also { result -> - e.project?.let { project -> + project?.let { project -> sendTopic(JOB_ADDED_TOPIC, project).submitted(project, connectionConfig, file.parent.path, result) } } @@ -84,4 +84,4 @@ class SubmitJobToolbarAction: AnAction() { override fun isDumbAware(): Boolean { return true } -} \ No newline at end of file +} From b27e4da6f3806c1fa31b93b85e10a7976117276b Mon Sep 17 00:00:00 2001 From: Uladzislau Kalesnikau Date: Tue, 9 Jan 2024 12:23:44 +0100 Subject: [PATCH 21/22] Update FileEditorEventsListener.kt --- .../ibagroup/formainframe/editor/FileEditorEventsListener.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt index 31a64f64f..7c29caaaa 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/editor/FileEditorEventsListener.kt @@ -39,8 +39,8 @@ class FileEditorEventsListener : FileEditorManagerListener { override fun fileOpened(source: FileEditorManager, file: VirtualFile) { if (file is MFVirtualFile) { val editor = source.selectedTextEditor as? EditorEx - - editor?.addFocusListener(focusListener) + editor?.addFocusListener(focusListener) + } super.fileOpened(source, file) } } From fb706688c404ec4b3d61760fd699b4a34b76c17c Mon Sep 17 00:00:00 2001 From: Uladzislau Date: Thu, 18 Jan 2024 14:19:40 +0100 Subject: [PATCH 22/22] Small fix for the release Signed-off-by: Uladzislau --- .../formainframe/explorer/actions/SubmitJobToolbarAction.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 7bbf6c72a..e969ba2af 100644 --- a/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt +++ b/src/main/kotlin/eu/ibagroup/formainframe/explorer/actions/SubmitJobToolbarAction.kt @@ -53,7 +53,7 @@ class SubmitJobToolbarAction: AnAction() { ), progressIndicator = it ).also { result -> - project?.let { project -> + e.project?.let { project -> sendTopic(JOB_ADDED_TOPIC, project).submitted(project, connectionConfig, file.parent.path, result) } }