iSeries Remote Systems
v6.0.1

com.ibm.etools.iseries.core.ui.actions.isv
Class ISeriesAbstractIFSPopupMenuExtensionAction

java.lang.Object
  extended bycom.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction
      extended bycom.ibm.etools.systems.core.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction
          extended bycom.ibm.etools.iseries.core.ui.actions.isv.ISeriesAbstractIFSPopupMenuExtensionAction
All Implemented Interfaces:
IActionDelegate, IObjectActionDelegate

public abstract class ISeriesAbstractIFSPopupMenuExtensionAction
extends com.ibm.etools.systems.core.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction
implements IObjectActionDelegate

This is a base class to simplify the creation of actions supplied via the com.ibm.etools.systems.core.popupMenus extension point, targeting IFS files and/or IFS folders.

The runCommand method in this action runs QSHELL commands only. To run QSYS commands, use the runQSYSCommand method instead.

The only method you must implement is run(). You may optionally override getEnabled(Object[])

Convenience methods available in this class:

See also the convenience methods available in the parent class SystemAbstractRemoteFilePopupMenuExtensionAction and the grandparent class SystemAbstractPopupMenuExtensionAction


Field Summary
static String copyright
           
 
Fields inherited from class com.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction
EMPTY_ARRAY, proxyAction, sel, shell, viewPart
 
Constructor Summary
ISeriesAbstractIFSPopupMenuExtensionAction()
          Constructor
 
Method Summary
 boolean getEnabled(Object[] currentlySelected)
          The user has selected one or more objects.
protected  CmdSubSystem getQSYSCommandSubSystem()
          Internal method to find and return the associated QSYS command subsystem, for the purpose of issuing a remote command
abstract  void run()
          The user has selected this action.
 Object[] runQSYSCommand(String command)
          Execute a remote QSYS command.
protected  CmdSubSystem selectQSYSSubSystem(com.ibm.etools.systems.subsystems.SubSystem[] allCmdSubSystems)
          Internal method to select the appropriate command subsystem when there are multiple defined for this connection.
 
Methods inherited from class com.ibm.etools.systems.core.ui.actions.SystemAbstractRemoteFilePopupMenuExtensionAction
getFirstSelectedRemoteFile, getRemoteFileSubSystem, getRemoteFileSubSystemFactory, getSelectedRemoteFiles
 
Methods inherited from class com.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction
getActivePart, getCommandSubSystem, getFirstSelectedRemoteObject, getFirstSelectedRemoteObjectAdapter, getProxyAction, getRemoteAdapter, getRemoteObjectName, getRemoteObjectSubSubType, getRemoteObjectSubSystemFactoryId, getRemoteObjectSubType, getRemoteObjectType, getRemoteObjectTypeCategory, getSelectedRemoteObjectAdapters, getSelectedRemoteObjects, getSelection, getSelectionCount, getShell, getSubSystem, getSubSystemFactory, getSystemConnection, getWorkingDirectory, printTest, run, runCommand, runCommand, selectionChanged, setActivePart, setChecked, setEnabled, showInView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IObjectActionDelegate
setActivePart
 
Methods inherited from interface org.eclipse.ui.IActionDelegate
run, selectionChanged
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values
Constructor Detail

ISeriesAbstractIFSPopupMenuExtensionAction

public ISeriesAbstractIFSPopupMenuExtensionAction()
Constructor

Method Detail

run

public abstract void run()
The user has selected this action. This is where the actual code for the action goes.


getEnabled

public boolean getEnabled(Object[] currentlySelected)
The user has selected one or more objects. This is an opportunity to enable/disable this action based on the current selection.

The default implementation of this method returns false if all the objects are not of type IRemoteFile and are IFS file or folders.


runQSYSCommand

public Object[] runQSYSCommand(String command)
Execute a remote QSYS command. What this does is find the associated QSYS command subsystem for the remote objects, and submits the command to it to be run. The command and its results are logged in the command console view, for the user to see. If an exception occurs for some reason, it is shown to the user, and null is returned. Otherwise an array of objects is returned, typically representing messages issued by the remote command shell. If no messages are issued, an array of length zero is returned, as opposed to null when something goes wrong.

Note that the runCommand methods execute QSHELL commands. You must call this to run a QSYS command.

Parameters:
command - Command to be executed remotely.
Returns:
Array of objects that are the result of running this command. Typically, these are messages logged by the command.
See Also:
SystemAbstractPopupMenuExtensionAction.runCommand(String)

getQSYSCommandSubSystem

protected CmdSubSystem getQSYSCommandSubSystem()
Internal method to find and return the associated QSYS command subsystem, for the purpose of issuing a remote command


selectQSYSSubSystem

protected CmdSubSystem selectQSYSSubSystem(com.ibm.etools.systems.subsystems.SubSystem[] allCmdSubSystems)
Internal method to select the appropriate command subsystem when there are multiple defined for this connection. The default implementation is to return the first, but child classes can refine this. Input is always an array of length greater than one.


iSeries Remote Systems
v6.0.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.