RSE
Release 1.0

org.eclipse.rse.processes.ui.actions
Class SystemKillProcessAction

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.jface.action.AbstractAction
          extended byorg.eclipse.jface.action.Action
              extended byorg.eclipse.rse.ui.actions.SystemBaseAction
                  extended byorg.eclipse.rse.ui.actions.SystemBaseDialogAction
                      extended byorg.eclipse.rse.processes.ui.actions.SystemKillProcessAction
All Implemented Interfaces:
IAction, IRunnableWithProgress, ISelectionChangedListener, ISystemAction, ISystemDialogAction

public class SystemKillProcessAction
extends SystemBaseDialogAction
implements IRunnableWithProgress


Field Summary
protected  boolean killedOk
           
protected  Object[] processesDeathRow
           
protected  Exception runException
           
protected  String signalType
           
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
cancelled, dlgHelpId, needsProgressMonitor, needsProgressMonitorSet, processAll, value
 
Fields inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, arrowCursor, helpId, selectionSensitive, shell, sSelection, traceSelections, traceTarget, viewer, waitCursor
 
Fields inherited from interface org.eclipse.jface.action.IAction
AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
 
Constructor Summary
SystemKillProcessAction(Shell shell)
          Constructor for subclass
 
Method Summary
protected  Dialog createDialog(Shell shell)
          If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.
protected  boolean doKill(IProgressMonitor monitor, String signal, IRemoteProcess process)
           
protected  List getAffectedFilters(Object[] processesDeathRow, ISubSystem subSystem)
          Returns a list of all the filters that are affected by killing the objects in processesDeathRow.
protected  Object getDialogValue(Dialog dlg)
          Required by parent.
protected  SystemMessage getKillingMessage()
           
protected  SystemMessage getKillingMessage(String signal, String processName)
          Get the specific "kill" message
protected  IRunnableContext getRunnableContext()
          Get an IRunnable context to show progress in.
 void killComplete()
          Called after all the copy/move operations end, be it successfully or not.
protected  void populateSelectedObjects()
           
 void run(IProgressMonitor monitor)
          Method required by IRunnableWithProgress interface.
protected  void showOperationCancelledMessage(Shell shell)
          Show an error message when the user cancels the operation.
protected  void showOperationErrorMessage(Shell shell, SystemMessageException exc)
          Show an error message when the operation fails.
protected  void showOperationErrorMessage(Shell shell, Throwable exc)
          Show an error message when the operation fails.
protected  void showOperationMessage(Exception exc, Shell shell)
          Helper method to show an error message resulting from the attempted operation.
 boolean updateSelection(IStructuredSelection selection)
          We override from parent to do unique checking...
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseDialogAction
getDialogHelpContextId, getNeedsProgressMonitor, getProcessAllSelections, getValue, run, setDialogHelp, setNeedsProgressMonitor, setProcessAllSelections, setValue, wasCancelled, wasNeedsProgressMonitorSet
 
Methods inherited from class org.eclipse.rse.ui.actions.SystemBaseAction
allowOnMultipleSelection, checkObjectType, getAdapter, getContextMenuGroup, getCurrentTreeView, getFirstSelection, getHelpContextId, getNextSelection, getRemoteAdapter, getSelection, getSelectionProvider, getShell, getShell, getSystemConnection, getViewer, isDummy, isEnabled, isSelectionSensitive, issueTraceMessage, selectionChanged, setAvailableOffline, setBusyCursor, setContextMenuGroup, setDisplayCursor, setDisplayCursor, setHelp, setHost, setInputs, setSelection, setSelectionProvider, setSelectionSensitive, setShell, setTracing, setTracing, setViewer
 
Methods inherited from class org.eclipse.jface.action.Action
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from class org.eclipse.jface.action.AbstractAction
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.rse.ui.actions.ISystemAction
allowOnMultipleSelection, getContextMenuGroup, getHelpContextId, getSelection, getShell, getViewer, isDummy, isSelectionSensitive, setContextMenuGroup, setHelp, setInputs, setSelection, setSelectionSensitive, setShell, setViewer
 
Methods inherited from interface org.eclipse.jface.action.IAction
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 
Methods inherited from interface org.eclipse.jface.viewers.ISelectionChangedListener
selectionChanged
 

Field Detail

runException

protected Exception runException

processesDeathRow

protected Object[] processesDeathRow

killedOk

protected boolean killedOk

signalType

protected String signalType
Constructor Detail

SystemKillProcessAction

public SystemKillProcessAction(Shell shell)
Constructor for subclass

Method Detail

updateSelection

public boolean updateSelection(IStructuredSelection selection)
We override from parent to do unique checking...

We simply ensure every selected object is an IRemoteProcess

Overrides:
updateSelection in class SystemBaseAction
See Also:
SystemBaseAction.updateSelection(IStructuredSelection)

getDialogValue

protected Object getDialogValue(Dialog dlg)
Required by parent. It is up to the caller to call wasCancelled() and if not true, do their own killing.

Specified by:
getDialogValue in class SystemBaseDialogAction
Parameters:
dlg - The dialog object, after it has returned from open.

createDialog

protected Dialog createDialog(Shell shell)
If you decide to use the supplied run method as is, then you must override this method to create and return the dialog that is displayed by the default run method implementation.

If you override run with your own, then simply implement this to return null as it won't be used.

Specified by:
createDialog in class SystemBaseDialogAction
See Also:
SystemBaseDialogAction.run()

getRunnableContext

protected IRunnableContext getRunnableContext()
Get an IRunnable context to show progress in. If there is currently a dialog or wizard up with a progress monitor in it, we will use this, else we will create a progress monitor dialog.


run

public void run(IProgressMonitor monitor)
         throws InvocationTargetException,
                InterruptedException
Method required by IRunnableWithProgress interface. Allows execution of a long-running operation modally by via a thread. In our case, it runs the kill operation with a visible progress monitor

Specified by:
run in interface IRunnableWithProgress
Throws:
InvocationTargetException
InterruptedException

doKill

protected boolean doKill(IProgressMonitor monitor,
                         String signal,
                         IRemoteProcess process)
                  throws Exception
Parameters:
monitor - Usually not needed
signal - the signal to be sent to the remote process
process - the process to send the signal to
Throws:
Exception

killComplete

public void killComplete()
Called after all the copy/move operations end, be it successfully or not. Your opportunity to display completion or do post-copy selections/refreshes


getAffectedFilters

protected List getAffectedFilters(Object[] processesDeathRow,
                                  ISubSystem subSystem)
Returns a list of all the filters that are affected by killing the objects in processesDeathRow.

Parameters:
processesDeathRow - the objects that will be sent a kill signal
subSystem - the subsystem to search
Returns:
a list of the affected filters

populateSelectedObjects

protected void populateSelectedObjects()

getKillingMessage

protected SystemMessage getKillingMessage()

getKillingMessage

protected SystemMessage getKillingMessage(String signal,
                                          String processName)
Get the specific "kill" message


showOperationMessage

protected void showOperationMessage(Exception exc,
                                    Shell shell)
Helper method to show an error message resulting from the attempted operation.


showOperationErrorMessage

protected void showOperationErrorMessage(Shell shell,
                                         Throwable exc)
Show an error message when the operation fails. Shows a common message by default. Overridable.


showOperationErrorMessage

protected void showOperationErrorMessage(Shell shell,
                                         SystemMessageException exc)
Show an error message when the operation fails. Shows a SystemMessage that was encapsulated in a SystemMessage exception Overridable.


showOperationCancelledMessage

protected void showOperationCancelledMessage(Shell shell)
Show an error message when the user cancels the operation. Shows a common message by default. Overridable.


RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.