Skip to content

Commit

Permalink
Merge branch 'private-release/v2.1.0' into zowe-release/v2.1.0
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Sep 28, 2024
2 parents 07bc0d8 + 38a3e12 commit 6254152
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@

package org.zowe.explorer.explorer.actions

import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.ui.showYesNoDialog
import org.zowe.explorer.explorer.JesWorkingSetImpl
import org.zowe.explorer.explorer.ui.*
import org.zowe.explorer.explorer.ui.JesExplorerView
import org.zowe.explorer.explorer.ui.JesFilterNode
import org.zowe.explorer.explorer.ui.JesWsNode
import org.zowe.explorer.explorer.ui.getExplorerView
import org.zowe.explorer.utils.performUnitsDeletionBasedOnSelection
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty

/**
* Action class for delete JES node action (working set or filter)
Expand All @@ -48,8 +47,10 @@ class DeleteJesNodeAction : AnAction() {
val jesFiltersToDelete = selectedFilters.filter { jesFilter -> !workingSetsToDelete.contains(jesFilter.parent) }

// Delete working sets and filters that do not belong to them
(workingSetsToDelete + jesFiltersToDelete).ifNotEmpty {
performUnitsDeletionBasedOnSelection(e.project, null, view)
(workingSetsToDelete + jesFiltersToDelete).apply {
if (isNotEmpty()) {
performUnitsDeletionBasedOnSelection(e.project, null, view)
}
}
}

Expand All @@ -70,6 +71,6 @@ class DeleteJesNodeAction : AnAction() {
}
val selected = view.mySelectedNodesData
e.presentation.isEnabledAndVisible = selected.isNotEmpty()
&& (selected[0].node is JesWsNode || selected[0].node is JesFilterNode)
&& (selected[0].node is JesWsNode || selected[0].node is JesFilterNode)
}
}
19 changes: 6 additions & 13 deletions src/main/kotlin/org/zowe/explorer/explorer/ui/FileExplorerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,14 @@
package org.zowe.explorer.explorer.ui

import com.intellij.icons.AllIcons
import com.intellij.ide.CopyPasteSupport
import com.intellij.ide.CopyProvider
import com.intellij.ide.CutProvider
import com.intellij.ide.DeleteProvider
import com.intellij.ide.PasteProvider
import com.intellij.ide.*
import com.intellij.ide.dnd.DnDManager
import com.intellij.ide.dnd.DnDSource
import com.intellij.ide.dnd.DnDTarget
import com.intellij.ide.dnd.FileCopyPasteUtil
import com.intellij.ide.projectView.ProjectView
import com.intellij.openapi.Disposable
import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.PlatformDataKeys
import com.intellij.openapi.actionSystem.*
import com.intellij.openapi.ide.CopyPasteManager
import com.intellij.openapi.progress.runModalTask
import com.intellij.openapi.project.Project
Expand All @@ -54,7 +46,6 @@ import org.zowe.explorer.utils.getMinimalCommonParents
import org.zowe.explorer.utils.getParentsChain
import org.zowe.explorer.utils.performUnitsDeletionBasedOnSelection
import org.zowe.explorer.vfs.MFVirtualFile
import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
import java.awt.Toolkit
import java.awt.datatransfer.DataFlavor
import java.awt.datatransfer.Transferable
Expand Down Expand Up @@ -446,8 +437,10 @@ class FileExplorerView(
val masksToDelete = selectedMasks.filter { mask -> !workingSetsToDelete.contains(mask.parent) }

// Delete working sets and masks that do not belong to them
(workingSetsToDelete + masksToDelete).ifNotEmpty {
performUnitsDeletionBasedOnSelection(project, this@FileExplorerView, null)
(workingSetsToDelete + masksToDelete).apply {
if (isNotEmpty()) {
performUnitsDeletionBasedOnSelection(project, this@FileExplorerView, null)
}
}

// perform files deletion
Expand Down

0 comments on commit 6254152

Please sign in to comment.