All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.eNetwork.beans.HOD.MacroManager

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----com.ibm.eNetwork.beans.HOD.HODPanelBean
                                   |
                                   +----com.ibm.eNetwork.beans.HOD.MacroManager

public class MacroManager
extends HODPanelBean
implements SendKeyListener, CommListener, ScreenListener, ActionListener, WindowListener, ECLConstants, HelpSource, HODConstants, ItemListener, MacroRuntimeListener, MacroParseListener, MacroDebugListener, MacroIOProvider, MacroManagerIntf, ScreenMouseListener
The MacroManager bean is a Graphical User Interface for creating, playing, and managing macros when it is wired to either a Terminal bean or a Session bean.

MacroManager is a button bar (toolbar) that lets you take full advantage of the recording and playing capabilities of the Macro bean. You can do simple or advanced recording of a macro.

With simple recording, general and reliable screen recognition will be used automatically in the macro(s). This screen recognition will take full advantage of the screen recognition technology in the IBM Host Access Class Library.

With advanced recording, you can specifically tailor the screen matching to your host application screens. You can define characteristics of a screen by number of fields, number of input fields, cursor position, keywords, and the Operator Information Area (OIA) state.

You can also insert prompts into the macro with advanced recording. These prompts can be defined as either password or normal display and will automatically place the text the user inputs into the prompt dialog during playback. The final feature of advanced recording is inserting extracts into a macro. When the extract button is toggled down, you may mark any part of the Presentation Space of the Terminal or Screen bean you are wired to and the area marked is retrieved and fired in an event during playback.

MacroManager contains a list of all macros currently available through the connected MacroIOProvider (see below). You may choose any macro from the list to play, record (overwrite or append), edit, and delete.

IMPORTANT: It is essential that an object which implements MacroIOProvider be wired to this bean. Without an IO provider this bean will disable all functions. MacroManager does not perform its own file I/O. Instead, it defers it to the application surrounding MacroManager. MacroIOProviders are responsible for listing all available macros and saving and retrieving those macros from persistent storage.

Properties

The following table lists the properties of the MacroManager Bean:

* - Properties with type "enum" are String types that accept a specific set of string values. The valid values for an enum property can be obtained by calling the list <property name> method. The set method for enum properties validates the value before any changes are accepted, and a PropertyVetoException is thrown if an incorrect value is given.

Note: All properties are bound and vetoable. A PropertyChangeEvent is fired to all PropertyChangeListeners after a property is changed. A vetoable PropertyChangeEvent is fired to all VetoableChangeListeners before a property is changed. VetoableChangeListeners can veto a property change by throwing a PropertyVetoException.

Property Name Type Default Access
recordEnabled boolean true read/write
advRecordEnabled boolean true read/write
buttonTextVisible boolean true read/write
recordUI boolean false read/write
state int STATE_DISCONNECTED read

Events Fired

Event Type Fired To Event Handler Method
MacroPromptEvent - Fired when a macro contains prompt commands. Any MacroRuntimeListener macroPromptEvent(MacroPromptEvent)
MacroExtractEvent - Fired when a macro contains extract commands. Any MacroRuntimeListener macroExtractEvent(MacroExtractEvent)
MacroStateEvent - Fired when a macro changes state. Any MacroRuntimeListener macroStateEvent(MacroStateEvent)
PropertyChangeEvent - Fired when a property of the Bean is changed. Any PropertyChangeListener propertyChange(propertyChangeEvent)
Vetoable PropertyChangeEvent - Fired when a vetoable property of the Bean is changed. Any VetoableChangeListener vetoableChange(PropertyChangeEvent)

Events Accepted

Event Type Fired From Event Handler Method
CommEvent Terminal, Session commEvent(commEvent)
SendKeyEvent Terminal, Screen sendKeyEvent(SendKeyEvent)
ScreenEvent Terminal, Screen boxSelected(ScreenEvent)

See Also:
Macro, MacroIOProvider

Variable Index

 o ADVRECORD_ENABLED
AdvRecordEnabled property keyword.
 o BUTTON_TEXT_VISIBLE
ButtonTextVisible property keyword.
 o MACRO_LIST
MacroList property keyword.
 o RECORD_ENABLED
RecordEnabled property keyword.
 o RECORD_UI
RecordUI property keyword.
 o STATE
State property keyword.

Constructor Index

 o MacroManager()
Constructs a MacroManager bean.
 o MacroManager(Macro)
Constructs a MacroManager bean and sets the Macro bean contained by MacroManager.
 o MacroManager(Properties)
Constructs a MacroManager bean from a Properties object.

Method Index

 o addMacroDebugListener(MacroDebugListener)
Adds the given MacroDebugListener to list of listeners.
 o addMacroParseListener(MacroParseListener)
Adds the given MacroParseListener to list of listeners.
 o addMacroRuntimeListener(MacroRuntimeListener)
Adds the given MacroRuntimeListener to list of listeners.
 o clone()
Returns a new instance of MacroManager with the same state as the current one.
 o getMacroBean()
Returns the Macro object contained by MacroManager.
 o getMacroList()
Returns the list of currently available macros.
 o getState()
Returns the state of the current macro.
 o getTraceName()
Returns a trace identifier for this bean
 o isAdvRecordEnabled()
Returns advanced recording capabilities state of MacroManager.
 o isButtonTextVisible()
Returns the text visibility state of the text in the buttons of MacroManager.
 o isRecordEnabled()
Returns recording capabilities state of MacroManager.
 o isRecordUI()
Returns whether the Macro will record user interface events on the Terminal bean.
 o pause()
Toggles pause recording or playing the macro.
 o play()
Toggles the play state of the current macro.
 o record()
Starts recording a macro or resumes recording a paused macro.
 o removeMacroDebugListener(MacroDebugListener)
Removes the given MacroDebugListener from list of listeners.
 o removeMacroIOProvider(MacroIOProvider)
Removes the given MacroIOProvider from MacroManager.
 o removeMacroParseListener(MacroParseListener)
Removes the given MacroParseListener from the list of listeners.
 o removeMacroRuntimeListener(MacroRuntimeListener)
Removes the given MacroRuntimeListener from list of listeners.
 o setAdvRecordEnabled(boolean)
Turns off/on advanced recording capabilities of MacroManager.
 o setButtonTextVisible(boolean)
Sets the text visibility state of the text in the buttons of MacroManager.
 o setMacroBean(Macro)
Sets the Macro object contained by MacroManager.
 o setMacroIOProvider(MacroIOProvider)
Sets the given MacroIOProvider for MacroManager.
 o setMacroList(Vector)
Sets the list of currently available macros.
 o setPrompts(MacroPrompts)
Sets the macro prompts.
 o setRecordEnabled(boolean)
Turns off/on recording capabilities of MacroManager.
 o setRecordUI(boolean)
Sets whether the Macro will record user interface events on the Terminal bean.
 o setSelectedMacro(String)
Sets the macro with the given name to the current macro in MacroManager.
 o stop()
Stops recording or playing the macro.

Variables

 o RECORD_ENABLED
 public static final String RECORD_ENABLED
RecordEnabled property keyword.

 o ADVRECORD_ENABLED
 public static final String ADVRECORD_ENABLED
AdvRecordEnabled property keyword.

 o STATE
 public static final String STATE
State property keyword.

 o MACRO_LIST
 public static final String MACRO_LIST
MacroList property keyword.

 o BUTTON_TEXT_VISIBLE
 public static final String BUTTON_TEXT_VISIBLE
ButtonTextVisible property keyword.

 o RECORD_UI
 public static final String RECORD_UI
RecordUI property keyword.

Constructors

 o MacroManager
 public MacroManager()
Constructs a MacroManager bean.

 o MacroManager
 public MacroManager(Macro mac)
Constructs a MacroManager bean and sets the Macro bean contained by MacroManager.

Parameters:
mac - Macro bean object to set in MacroManager
 o MacroManager
 public MacroManager(Properties p) throws PropertyVetoException
Constructs a MacroManager bean from a Properties object.

Throws: PropertyVetoException
Thrown if error in setting property

Methods

 o getMacroBean
 public Macro getMacroBean()
Returns the Macro object contained by MacroManager.

Returns:
Macro object in the MacroManager object
 o setMacroBean
 public void setMacroBean(Macro val) throws MacroException
Sets the Macro object contained by MacroManager.

Parameters:
val - new Macro object for the MacroManager object
 o addMacroDebugListener
 public synchronized void addMacroDebugListener(MacroDebugListener listener) throws MacroException
Adds the given MacroDebugListener to list of listeners.

Parameters:
listener - The MacroDebugListener to be added
Throws: MacroException
thrown if an incorrect parameter is passed or if Macro experiences an internal error
See Also:
removeMacroDebugListener
 o removeMacroDebugListener
 public synchronized void removeMacroDebugListener(MacroDebugListener listener) throws MacroException
Removes the given MacroDebugListener from list of listeners.

Parameters:
listener - The MacroDebugListener to be removed
Throws: MacroException
thrown if an incorrect parameter is passed or if Macro experiences an internal error
See Also:
addMacroDebugListener
 o addMacroRuntimeListener
 public synchronized void addMacroRuntimeListener(MacroRuntimeListener listener)
Adds the given MacroRuntimeListener to list of listeners.

Parameters:
listener - The MacroRuntimeListener to be added
See Also:
removeMacroRuntimeListener
 o removeMacroRuntimeListener
 public synchronized void removeMacroRuntimeListener(MacroRuntimeListener listener) throws MacroException
Removes the given MacroRuntimeListener from list of listeners.

Parameters:
listener - The MacroRuntimeListener to be removed
See Also:
addMacroRuntimeListener
 o addMacroParseListener
 public synchronized void addMacroParseListener(MacroParseListener listener) throws MacroException
Adds the given MacroParseListener to list of listeners.

Parameters:
listener - The MacroParseListener to be added
Throws: MacroException
thrown if an incorrect parameter is passed or if Macro experiences an internal error
See Also:
removeMacroParseListener
 o removeMacroParseListener
 public synchronized void removeMacroParseListener(MacroParseListener listener) throws MacroException
Removes the given MacroParseListener from the list of listeners.

Parameters:
listener - The MacroParseListener to be removed
Throws: MacroException
thrown if an incorrect parameter is passed or if Macro experiences an internal error
See Also:
addMacroParseListener
 o setMacroIOProvider
 public synchronized void setMacroIOProvider(MacroIOProvider o) throws MacroException
Sets the given MacroIOProvider for MacroManager. One and only one provider may be attached to MacroManager at a time. MacroManager has a default MacroIOProvider implementation internally implemented that saves, retrieves, and deletes macros in the directory from which the class was loaded. This internal MacroIOProvider is active if no external MacroIOProvider is set.

An object that implements the MacroIOProvider interface is responsible for providing MacroManager with its Macros. It is also responsible for saving macros that MacroManager records. MacroManager purposefully does not perform any file I/O. It was designed so to allow for the maximum amount of flexibility concerning input and output. See MacroIOProvider for a more detailed discussion.

Parameters:
o - The MacroIOProvider to be added.
See Also:
removeMacroIOProvider, MacroIOProvider
 o removeMacroIOProvider
 public synchronized void removeMacroIOProvider(MacroIOProvider o) throws MacroException
Removes the given MacroIOProvider from MacroManager.

Parameters:
listener - The MacroIOProvider to be removed
See Also:
setMacroIOProvider
 o setRecordEnabled
 public void setRecordEnabled(boolean rec) throws PropertyVetoException
Turns off/on recording capabilities of MacroManager.

Parameters:
rec - If true, enables recording functions.
Throws: PropertyVetoException
Thrown if error in setting property
 o isRecordEnabled
 public boolean isRecordEnabled()
Returns recording capabilities state of MacroManager.

 o setAdvRecordEnabled
 public void setAdvRecordEnabled(boolean advrec) throws PropertyVetoException
Turns off/on advanced recording capabilities of MacroManager. These include inserting a smart wait, a prompt, and an extract.

Parameters:
advrec - If true, enables advanced recording functions.
Throws: PropertyVetoException
Thrown if error in setting property
 o isAdvRecordEnabled
 public boolean isAdvRecordEnabled()
Returns advanced recording capabilities state of MacroManager.

 o getState
 public int getState()
Returns the state of the current macro. Returned value is one of the Macro state constants.

See Also:
Macro
 o setMacroList
 public void setMacroList(Vector propList) throws PropertyVetoException
Sets the list of currently available macros. These macros must be provided by the current MacroIOProvider.

Parameters:
propList - Vector of Property objects, each of which represents a single macro.
Throws: PropertyVetoException
Thrown if error in setting property
See Also:
getMacroList
 o getMacroList
 public Vector getMacroList()
Returns the list of currently available macros. This list was set by the current MacroIOProvider. The returned Vector contains a set of Property objects.

 o setButtonTextVisible
 public void setButtonTextVisible(boolean state) throws PropertyVetoException
Sets the text visibility state of the text in the buttons of MacroManager.

Parameters:
state - true for visible, false for invisible
Throws: PropertyVetoException
Thrown if an incorrect property value is given.
 o isButtonTextVisible
 public boolean isButtonTextVisible()
Returns the text visibility state of the text in the buttons of MacroManager.

 o setRecordUI
 public void setRecordUI(boolean newVal) throws PropertyVetoException
Sets whether the Macro will record user interface events on the Terminal bean. These are events like mouse clicks and box selection. The default is for Macro to not record UI events.

Note: if this property is set to true, cursor position will not be automatically recorded in the screen descriptions. This happens because the Macro bean is unable to reliably determine the place of the cursor when mouse clicks move the cursor.

Parameters:
newVal - if true, UI events will be recorded.
 o isRecordUI
 public boolean isRecordUI()
Returns whether the Macro will record user interface events on the Terminal bean. These are events like mouse clicks and box selection. The default is for Macro to not record UI events.

Returns:
if true, UI events will be recorded.
 o clone
 public synchronized Object clone()
Returns a new instance of MacroManager with the same state as the current one.

Overrides:
clone in class HODPanelBean
 o setSelectedMacro
 public synchronized void setSelectedMacro(String name) throws MacroException
Sets the macro with the given name to the current macro in MacroManager. This will cause MacroManager to call the getMacro(name) method on the connected MacroIOProvider.

Parameters:
name - Name of macro to select.
 o record
 public void record()
Starts recording a macro or resumes recording a paused macro.

 o stop
 public void stop()
Stops recording or playing the macro.

 o play
 public void play()
Toggles the play state of the current macro.

 o pause
 public void pause()
Toggles pause recording or playing the macro.

 o setPrompts
 public synchronized void setPrompts(MacroPrompts macPrompts) throws MacroException
Sets the macro prompts. Use when a MacroPromptEvent occurs.

Parameters:
macPrompts - MacroPrompts object with prompt data filled in.
See Also:
MacroPrompts, MacroPromptEvent
 o getTraceName
 public String getTraceName()
Returns a trace identifier for this bean

Overrides:
getTraceName in class HODPanelBean

All Packages  Class Hierarchy  This Package  Previous  Next  Index