Skip to content

Commit

Permalink
Merge branch 'private-release/v1.2.0-231' into zowe-release/v1.2.0-231
Browse files Browse the repository at this point in the history
Signed-off-by: Uladzislau <[email protected]>
  • Loading branch information
KUGDev committed Apr 8, 2024
2 parents 0a064c5 + 876156b commit 2295f36
Show file tree
Hide file tree
Showing 32 changed files with 279 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,28 @@

package org.zowe.explorer.dataops.content.synchronizer

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
import com.intellij.openapi.actionSystem.ex.ActionUtil
import com.intellij.openapi.components.service
import com.intellij.openapi.editor.ex.EditorEx
import com.intellij.openapi.progress.runBackgroundableTask
import com.intellij.openapi.project.DumbAwareAction
import com.intellij.openapi.vfs.VirtualFile
import org.zowe.explorer.config.ConfigService
import org.zowe.explorer.dataops.DataOpsManager
import org.zowe.explorer.utils.*
import org.zowe.explorer.utils.castOrNull
import org.zowe.explorer.utils.checkEncodingCompatibility
import org.zowe.explorer.utils.runReadActionInEdtAndWait
import org.zowe.explorer.utils.runWriteActionInEdtAndWait
import org.zowe.explorer.utils.showSaveAnywayDialog

/** Sync action event. It will handle the manual sync button action when it is clicked */
class SyncAction : DumbAwareAction() {
override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Get a virtual file on which the event was triggered
* @param e the event to get the virtual file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.ui.SimpleToolWindowPanel
Expand All @@ -33,6 +34,10 @@ import javax.swing.event.HyperlinkEvent
*/
class AddConnectionAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/** Shows connection dialog */
override fun actionPerformed(e: AnActionEvent) {
val state = ConnectionDialog.showAndTestConnection(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import org.zowe.explorer.config.connect.CredentialService
Expand All @@ -24,6 +25,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets
*/
class AddJobsFilterAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/** Opens AddJobsFilterDialog and saves result. */
override fun actionPerformed(e: AnActionEvent) {
val view = e.getExplorerView<JesExplorerView>() ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import org.zowe.explorer.config.ws.DSMask
Expand All @@ -26,6 +27,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets
/** Action to add USS or z/OS mask */
class AddMaskAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/** Add new mask to the working set, where the action is triggered */
override fun actionPerformed(e: AnActionEvent) {
val view = e.getExplorerView<FileExplorerView>() ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand Down Expand Up @@ -38,6 +39,10 @@ import org.zowe.explorer.vfs.MFVirtualFile
/** Class that represents "Add member" action */
class AddMemberAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Create a new member in the dataset library
* @param e an action event to get the file explorer view and the project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
Expand All @@ -27,6 +28,9 @@ import org.zowe.explorer.utils.crudable.Crudable
*/
abstract class AddWsActionBase : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/** Shows add Working Set dialog (for files or for jobs) */
override fun actionPerformed(e: AnActionEvent) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.intellij.notification.Notification
import com.intellij.notification.NotificationAction
import com.intellij.notification.NotificationType
import com.intellij.notification.Notifications
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand Down Expand Up @@ -46,6 +47,10 @@ const val ALLOCATE_ACTION_NOTIFICATION_GROUP_ID = "org.zowe.explorer.explorer.Al

abstract class AllocateActionBase : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Returns null if object doesn't contain anything
* needed for allocation algorithm
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.zowe.explorer.explorer.actions

import com.intellij.notification.NotificationType
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand All @@ -24,6 +25,10 @@ import org.zowe.kotlinsdk.Job
/** Action to cancel a running job in the Jobs Tool Window */
class CancelJobAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

override fun isDumbAware(): Boolean {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand All @@ -27,7 +28,14 @@ import org.zowe.explorer.dataops.operations.UssAllocationOperation
import org.zowe.explorer.dataops.operations.UssAllocationParams
import org.zowe.explorer.dataops.operations.UssChangeModeOperation
import org.zowe.explorer.dataops.operations.UssChangeModeParams
import org.zowe.explorer.explorer.ui.*
import org.zowe.explorer.explorer.ui.CreateFileDialog
import org.zowe.explorer.explorer.ui.CreateFileDialogState
import org.zowe.explorer.explorer.ui.ExplorerUnitTreeNodeBase
import org.zowe.explorer.explorer.ui.FileExplorerView
import org.zowe.explorer.explorer.ui.UssDirNode
import org.zowe.explorer.explorer.ui.UssFileNode
import org.zowe.explorer.explorer.ui.getExplorerView
import org.zowe.explorer.explorer.ui.toAllocationParams
import org.zowe.explorer.utils.castOrNull
import org.zowe.explorer.vfs.MFVirtualFile
import org.zowe.kotlinsdk.ChangeMode
Expand All @@ -38,6 +46,10 @@ import org.zowe.kotlinsdk.FileType
*/
abstract class CreateUssEntityAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Uss file state which contains parameters for creating.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
package org.zowe.explorer.explorer.actions

import com.intellij.icons.AllIcons
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.ui.showYesNoDialog
Expand All @@ -25,6 +26,10 @@ import org.zowe.explorer.explorer.ui.getExplorerView
*/
class DeleteJesNodeAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Called when delete JES element option is chosen from context menu
*/
Expand Down Expand Up @@ -83,6 +88,6 @@ class DeleteJesNodeAction : AnAction() {
}
val selected = view.mySelectedNodesData
e.presentation.isEnabledAndVisible = selected.isNotEmpty()
&& (selected[0].node is JesWsNode || selected[0].node is JesFilterNode)
&& (selected[0].node is JesWsNode || selected[0].node is JesFilterNode)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand All @@ -19,13 +20,24 @@ import org.zowe.explorer.config.connect.ConnectionConfig
import org.zowe.explorer.dataops.DataOpsManager
import org.zowe.explorer.dataops.attributes.RemoteMemberAttributes
import org.zowe.explorer.dataops.operations.RenameOperation
import org.zowe.explorer.explorer.ui.*
import org.zowe.explorer.explorer.ui.ExplorerTreeView
import org.zowe.explorer.explorer.ui.FetchNode
import org.zowe.explorer.explorer.ui.FileExplorerView
import org.zowe.explorer.explorer.ui.FileLikeDatasetNode
import org.zowe.explorer.explorer.ui.NodeData
import org.zowe.explorer.explorer.ui.RenameDialog
import org.zowe.explorer.explorer.ui.cleanCacheIfPossible
import org.zowe.explorer.explorer.ui.getExplorerView

/**
* Class which represents a duplicate member action
*/
class DuplicateMemberAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* The method of AnAction abstract class. Tells what to do if an action was submitted
*/
Expand All @@ -50,7 +62,12 @@ class DuplicateMemberAction : AnAction() {
* @throws any throwable during the processing of the request
* @return Void
*/
private fun runDuplicateOperation(project : Project, view : ExplorerTreeView<ConnectionConfig, *,*>, selectedNode : NodeData<ConnectionConfig>, newName: String) {
private fun runDuplicateOperation(
project: Project,
view: ExplorerTreeView<ConnectionConfig, *, *>,
selectedNode: NodeData<ConnectionConfig>,
newName: String
) {
val dataOpsManager = view.explorer.componentManager.getService(DataOpsManager::class.java)
val attributes = selectedNode.attributes ?: return
val file = selectedNode.file ?: return
Expand Down Expand Up @@ -98,7 +115,8 @@ class DuplicateMemberAction : AnAction() {
val selected = view.mySelectedNodesData
val node = selected.getOrNull(0)?.node
val nodeAttributes = selected.getOrNull(0)?.attributes
e.presentation.isVisible = selected.size == 1 && node is FileLikeDatasetNode && nodeAttributes is RemoteMemberAttributes
e.presentation.isVisible =
selected.size == 1 && node is FileLikeDatasetNode && nodeAttributes is RemoteMemberAttributes
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
Expand All @@ -31,6 +32,10 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey
*/
class EditFilesWorkingSetAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Called when edit working set option is chosen from context menu
* Opens the working set table with elements to edit
Expand All @@ -53,6 +58,7 @@ class EditFilesWorkingSetAction : AnAction() {
}
}
}

else -> {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.components.service
Expand All @@ -32,6 +33,10 @@ import org.zowe.explorer.vfs.MFVirtualFile
*/
class EditJclAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

override fun isDumbAware(): Boolean {
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
Expand All @@ -29,7 +30,11 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey
/**
* Action class for edit JES working set act
*/
class EditJesWorkingSetAction: AnAction() {
class EditJesWorkingSetAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Called when edit JES working set option is chosen from context menu,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import org.zowe.explorer.config.configCrudable
Expand All @@ -29,6 +30,10 @@ import org.zowe.explorer.utils.getSelectedNodesWorkingSets
/** Action to edit job filter in JES working set tree view */
class EditJobsFilterAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/** Save changes when the dialog is fulfilled */
override fun actionPerformed(e: AnActionEvent) {
val view = e.getExplorerView<JesExplorerView>() ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

package org.zowe.explorer.explorer.actions

import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import org.zowe.explorer.config.configCrudable
Expand All @@ -34,6 +35,10 @@ import org.zowe.explorer.utils.crudable.getByUniqueKey
*/
class EditMaskAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

/**
* Edit changed dataset mask. Will remove the mask from dataset masks list and add it to USS paths list
* if the mask type changed
Expand Down
Loading

0 comments on commit 2295f36

Please sign in to comment.