Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.actions.popupmenu
Class ISeriesAbstractQSYSPopupMenuAction

java.lang.Object
  extended by com.ibm.etools.iseries.rse.ui.actions.popupmenu.SystemAbstractPopupMenuAction
      extended by com.ibm.etools.iseries.rse.ui.actions.popupmenu.ISeriesAbstractQSYSPopupMenuAction

public abstract class ISeriesAbstractQSYSPopupMenuAction
extends SystemAbstractPopupMenuAction

This is a base class to simplify the creation of actions supplied via the com.ibm.etools.systems.core.popupMenus extension point, targeting objects in the QSYS file system.

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 com.ibm.etools.systems.core.ui.actions.SystemAbstractPopupMenuExtensionAction


Field Summary
protected  Hashtable convertedObjects
           
static String copyright
           
protected  boolean useHashTable
           
 
Fields inherited from class com.ibm.etools.iseries.rse.ui.actions.popupmenu.SystemAbstractPopupMenuAction
proxyAction, sel, shell, viewPart
 
Constructor Summary
ISeriesAbstractQSYSPopupMenuAction()
          Constructor
 
Method Summary
 boolean getEnabled(Object[] currentlySelected)
          The user has selected one or more objects.
 IBMiConnection getISeriesConnection()
          Return the ISeriesConnection from which the selected remote objects were resolved.
protected  Object getISeriesObjectFromRemoteObject(Object remoteObject)
          Given a remote object in its native format, return a key value to canonically represent it.
 IQSYSLibrary[] getSelectedLibraries()
          Return the selected objects as an array of ISeriesLibrary objects.
 IQSYSMember[] getSelectedMembers()
          Return the selected objects as an array of ISeriesMember objects.
 IQSYSObject[] getSelectedObjects()
          Return the selected objects as an array of ISeriesObject objects or ISeriesFile objects (the latter is a subclass of the former).
 IISeriesRecord[] getSelectedRecords()
          Return the selected objects as an array of ISeriesRecord objects.
 void reset()
          Call this from your run() method if you re-use this action between runs.
abstract  void run()
          The user has selected this action.
 Object[] runCommand(String command)
          Intercept of parent method so we can implement it uniquely for QSYS commands versus QSHELL command.
 
Methods inherited from class com.ibm.etools.iseries.rse.ui.actions.popupmenu.SystemAbstractPopupMenuAction
getActivePart, getCommandSubSystem, getFirstSelectedRemoteObject, getFirstSelectedRemoteObjectAdapter, getProxyAction, getRemoteAdapter, getRemoteObjectName, getRemoteObjectSubSubType, getRemoteObjectSubSystemFactoryId, getRemoteObjectSubType, getRemoteObjectType, getRemoteObjectTypeCategory, getSelectedRemoteObjectAdapters, getSelectedRemoteObjects, getSelection, getSelectionCount, getShell, getSubSystem, getSubSystemConfiguration, getSystemConnection, getWorkingDirectory, printTest, run, selectionChanged, setActivePart, setChecked, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright
See Also:
Constant Field Values

convertedObjects

protected Hashtable convertedObjects

useHashTable

protected boolean useHashTable
Constructor Detail

ISeriesAbstractQSYSPopupMenuAction

public ISeriesAbstractQSYSPopupMenuAction()
Constructor

Method Detail

run

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

Specified by:
run in class SystemAbstractPopupMenuAction

reset

public void reset()
Call this from your run() method if you re-use this action between runs. It clears instance variables.


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 true. Override to refine.

Overrides:
getEnabled in class SystemAbstractPopupMenuAction

runCommand

public Object[] runCommand(String command)
Intercept of parent method so we can implement it uniquely for QSYS commands versus QSHELL command.
Execute a remote QSYS command. What this does is find the associated command subsystem for the remote objects, and submit the command to it to be run. The command and its results are logged in the iSeries 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.

Overrides:
runCommand in class SystemAbstractPopupMenuAction
Parameters:
command - Command to be executed remotely.
Returns:
Array of objects that are the result of running this command. These are ISeriesMessage objects.

getISeriesConnection

public IBMiConnection getISeriesConnection()
Return the ISeriesConnection from which the selected remote objects were resolved. An ISeriesConnection is a wrapper of the more generic SystemConnection, containing specialized iSeries convenience methods.


getSelectedLibraries

public IQSYSLibrary[] getSelectedLibraries()
Return the selected objects as an array of ISeriesLibrary objects. Only valid if the selected objects are libraries, otherwise returns null. This should only be called for actions that have been scoped by typecategoryfilter="LIBRARIES"


getSelectedObjects

public IQSYSObject[] getSelectedObjects()
Return the selected objects as an array of ISeriesObject objects or ISeriesFile objects (the latter is a subclass of the former). Only valid if the selected objects are iSeries objects versus libraries or members, otherwise returns null. This should only be called for actions that have been scoped by typecategoryfilter="OBJECTS" or typecategoryfilter="OBJECTFILES"


getSelectedMembers

public IQSYSMember[] getSelectedMembers()
Return the selected objects as an array of ISeriesMember objects. Only valid if the selected objects are members, otherwise returns null. This should only be called for actions that have been scoped by typecategoryfilter="MEMBERS"


getSelectedRecords

public IISeriesRecord[] getSelectedRecords()
Return the selected objects as an array of ISeriesRecord objects. Only valid if the selected objects are records, otherwise returns null. This should only be called for actions that have been scoped by typecategoryfilter="RECORDS"


getISeriesObjectFromRemoteObject

protected Object getISeriesObjectFromRemoteObject(Object remoteObject)
Given a remote object in its native format, return a key value to canonically represent it. This is used as the key into the hashtable of ISeriesXXXX converted objects (the RSE lists DataElement objects, not ISeriesXXX objects, so they need to be converted).


Rational Developer for Power Systems Software
V7.6

Copyright © 2011 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.