RSE
Release 1.0

org.eclipse.rse.shells.ui.actions
Class SystemCommandAction

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.shells.ui.actions.SystemCommandAction
All Implemented Interfaces:
IAction, ISelectionChangedListener, ISystemAction

public class SystemCommandAction
extends SystemBaseAction

Launches a shell and/or runs a shell command, displaying the output in the Remote Shell view.


Nested Class Summary
 class SystemCommandAction.CommandDialog
          The command dialog used when running a command.
 
Field Summary
 
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
SystemCommandAction(Shell parent)
          Constructor for SystemCommandAction
SystemCommandAction(Shell parent, boolean isShell)
          Constructor for SystemCommandAction
SystemCommandAction(Shell parent, boolean isShell, IRemoteCmdSubSystem cmdSubSystem)
          Constructor for SystemCommandAction
SystemCommandAction(String title, Shell parent, boolean isShell, IRemoteCmdSubSystem cmdSubSystem)
          Constructor for SystemCommandAction
SystemCommandAction(String title, String tooltip, ImageDescriptor descriptor, Shell parent, boolean isShell, IRemoteCmdSubSystem cmdSubSystem)
          Constructor for SystemCommandAction
SystemCommandAction(String title, String tooltip, Shell parent, boolean isShell, IRemoteCmdSubSystem cmdSubSystem)
          Constructor for SystemCommandAction
 
Method Summary
 void run()
          Runs the command action.
 void setSubSystem(IRemoteCmdSubSystem ss)
           
 boolean updateSelection(IStructuredSelection selection)
          Called when the selection changes in the systems view.
 
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.jface.action.IAction
addPropertyChangeListener, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isHandled, removePropertyChangeListener, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
 

Constructor Detail

SystemCommandAction

public SystemCommandAction(Shell parent)
Constructor for SystemCommandAction

Parameters:
parent -

SystemCommandAction

public SystemCommandAction(Shell parent,
                           boolean isShell)
Constructor for SystemCommandAction

Parameters:
parent -
isShell - indication of whether this action launches a shell or runs a command

SystemCommandAction

public SystemCommandAction(Shell parent,
                           boolean isShell,
                           IRemoteCmdSubSystem cmdSubSystem)
Constructor for SystemCommandAction

Parameters:
parent -
isShell - indication of whether this action launches a shell or runs a command
cmdSubSystem - the command subsystem to use if launching a shell

SystemCommandAction

public SystemCommandAction(String title,
                           Shell parent,
                           boolean isShell,
                           IRemoteCmdSubSystem cmdSubSystem)
Constructor for SystemCommandAction

Parameters:
title - the title of the action
parent -
isShell - indication of whether this action launches a shell or runs a command
cmdSubSystem - the command subsystem to use if launching a shell

SystemCommandAction

public SystemCommandAction(String title,
                           String tooltip,
                           Shell parent,
                           boolean isShell,
                           IRemoteCmdSubSystem cmdSubSystem)
Constructor for SystemCommandAction

Parameters:
title - the title of the action
tooltip - the tooltip for the action
parent -
isShell - indication of whether this action launches a shell or runs a command
cmdSubSystem - the command subsystem to use if launching a shell

SystemCommandAction

public SystemCommandAction(String title,
                           String tooltip,
                           ImageDescriptor descriptor,
                           Shell parent,
                           boolean isShell,
                           IRemoteCmdSubSystem cmdSubSystem)
Constructor for SystemCommandAction

Parameters:
title - the title of the action
tooltip - the tooltip for the action
descriptor - the image descriptor for the action
parent -
isShell - indication of whether this action launches a shell or runs a command
cmdSubSystem - the command subsystem to use if launching a shell
Method Detail

setSubSystem

public void setSubSystem(IRemoteCmdSubSystem ss)

run

public void run()
Runs the command action. If the action is for launching a shell, the shell is launched and the remote shell view shows it's output. If the action is for running a command, a dialog pops up prompting for the invocation.

Specified by:
run in interface IAction
Overrides:
run in class SystemBaseAction
See Also:
Action.run()

updateSelection

public boolean updateSelection(IStructuredSelection selection)
Called when the selection changes in the systems view. This determines the input object for the command and whether to enable or disable the action.

Overrides:
updateSelection in class SystemBaseAction
Parameters:
selection - the current seleciton
Returns:
whether to enable or disable the action

RSE
Release 1.0

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