com.ibm.eNetwork.beans.HOD
Class MacroActionIf

java.lang.Object
  |
  +--com.ibm.eNetwork.beans.HOD.MacroAction
        |
        +--com.ibm.eNetwork.beans.HOD.MacroActionIf
All Implemented Interfaces:
com.ibm.eNetwork.HOD.common.HODConstants, com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable, java.io.Serializable

public class MacroActionIf
extends MacroAction

This class represents one if-else block of actions associated with a MacroScreen object. If the specified condition evaluates to true, the actions in the if block are executed. Otherwise, the conditions in the else block are executed.

See Also:
Serialized Form

Fields inherited from interface com.ibm.eNetwork.HOD.common.HODConstants
DEFAULT_WIN_FONT, HOD_ICON_EVENT, HOD_MSG_FILE, HOD_RAS_COMPID_ADVMACRO, HOD_RAS_COMPID_ASSOC_PRT, HOD_RAS_COMPID_BLINKREMAP, HOD_RAS_COMPID_CODEPAGE, HOD_RAS_COMPID_COLORREMAP, HOD_RAS_COMPID_CONFIG, HOD_RAS_COMPID_FILETRANSFER, HOD_RAS_COMPID_FTP_SCREEN, HOD_RAS_COMPID_FTP_SESSION, HOD_RAS_COMPID_FTP_TERMINAL, HOD_RAS_COMPID_FUDOMA, HOD_RAS_COMPID_HOD_API, HOD_RAS_COMPID_IMPEXP, HOD_RAS_COMPID_JNILOAD, HOD_RAS_COMPID_KEYPAD, HOD_RAS_COMPID_KEYREMAP, HOD_RAS_COMPID_MACRO, HOD_RAS_COMPID_MACROMANGR, HOD_RAS_COMPID_PRT_TERMINAL, HOD_RAS_COMPID_SCREEN, HOD_RAS_COMPID_SESSION, HOD_RAS_COMPID_SESSION_MGR, HOD_RAS_COMPID_SLP, HOD_RAS_COMPID_TERMINAL, HOD_RAS_COMPID_ZIPPRINT, HOD_RAS_FUNC_NAME, HOD_START_UP, HOD_TRANSFER_FILE_INFO, MOUSE_DOUBLE_CLICK_THRESHOLD, XFER_ASCII_GET_OPTIONS, XFER_ASCII_GET_OPTIONS_DEFAULT, XFER_ASCII_PUT_OPTIONS, XFER_ASCII_PUT_OPTIONS_DEFAULT, XFER_BINARY_GET_OPTIONS, XFER_BINARY_GET_OPTIONS_DEFAULT, XFER_BINARY_PUT_OPTIONS, XFER_BINARY_PUT_OPTIONS_DEFAULT, XFER_DEFAULT_OPTIONS, XFER_FILETYPE_DTA, XFER_FILETYPE_SAVF, XFER_FILETYPE_SRC, XFER_HOST_TYPE, XFER_HOST_TYPE_CICS, XFER_HOST_TYPE_CMS, XFER_HOST_TYPE_DEFAULT, XFER_HOST_TYPE_OS400, XFER_HOST_TYPE_TSO, XFER_PACKET_SIZE, XFER_PACKET_SIZE_DEFAULT, XFER_TIME_OUT_VALUE, XFER_TIME_OUT_VALUE_DEFAULT, XFER_TRANSFER_MODE, XFER_TRANSFER_MODE_ASCII, XFER_TRANSFER_MODE_BINARY, XFER_TRANSFER_MODE_DEFAULT
 
Constructor Summary
MacroActionIf()
          Constructs an empty instance of a macro if action.
MacroActionIf(java.lang.String condition, java.util.Vector ifacts, java.util.Vector elseacts)
          Constructs a working instance of a macro if action
 
Method Summary
 void execute()
          Calling this method does nothing; it does NOT execute the action.
 java.lang.String format(int argType, boolean formatAll)
          Formats the action object's contents into a readable string.
 java.lang.String getCondition()
          Returns the condition to be evaluated by the macro if action.
 java.util.Vector getElseActions()
          Returns the Vector of actions to be executed if the condition is false
 java.util.Vector getIfActions()
          Returns the Vector of actions to be executed if the condition is true
 void setCondition(java.lang.String argCond)
          Sets the condition to be evaluated by the macro if action.
 void setElseActions(java.util.Vector acts)
          Sets the Vector of actions to be executed if the condition is false
 void setIfActions(java.util.Vector acts)
          Sets the Vector of actions to be executed if the condition is true
 
Methods inherited from class com.ibm.eNetwork.beans.HOD.MacroAction
clone, equals, halt, setECLSession, setOwner, setRuntimeListeners
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.eNetwork.beans.HOD.macro.parser.MacroParsable
setAttributes, setError
 

Constructor Detail

MacroActionIf

public MacroActionIf()
Constructs an empty instance of a macro if action.

If you use this constructor, you must call all the set methods of this class to properly set up the action.


MacroActionIf

public MacroActionIf(java.lang.String condition,
                     java.util.Vector ifacts,
                     java.util.Vector elseacts)
              throws MacroException
Constructs a working instance of a macro if action

Parameters:
condition - determines which set of actions is executed
ifactions - vector of actions to be executed if condition is true
elseactions - vector of actions to be executed if condition is false
Throws:
MacroException - Fired if an invalid condition syntax is used
Method Detail

getCondition

public java.lang.String getCondition()
Returns the condition to be evaluated by the macro if action.
Returns:
condition to be evaluated

setCondition

public void setCondition(java.lang.String argCond)
                  throws MacroException
Sets the condition to be evaluated by the macro if action.
Parameters:
condition - condition to be evaluated
Throws:
MacroException - Fired if an invalid condition syntax is used

execute

public void execute()
Calling this method does nothing; it does NOT execute the action. The appropriate actions (if or else) will be executed during normal macro play.
Overrides:
execute in class MacroAction

setIfActions

public void setIfActions(java.util.Vector acts)
Sets the Vector of actions to be executed if the condition is true
Parameters:
acts - actions to be executed if condition is true

setElseActions

public void setElseActions(java.util.Vector acts)
Sets the Vector of actions to be executed if the condition is false
Parameters:
acts - actions to be executed if condition is false

getIfActions

public java.util.Vector getIfActions()
Returns the Vector of actions to be executed if the condition is true
Returns:
vector of actions

getElseActions

public java.util.Vector getElseActions()
Returns the Vector of actions to be executed if the condition is false
Returns:
vector of actions

format

public java.lang.String format(int argType,
                               boolean formatAll)
Formats the action object's contents into a readable string. Intended for visual feedback, as with the MacroDebugActionEvent class.
Overrides:
format in class MacroAction
Parameters:
argType - reserved, currently only XML strings are supported
formatAll - if true, optional parameters will be formatted also
Returns:
formatted string that reflects the contents of the action