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 IBM Host Access Class Library's screen
recognition technology.
With advanced recording, you can specifically tailor the screen matching
to your host application screens. You can define a screen's
characteristics 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 VetoableChangeEvent 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) |
VetoableChangeEvent - Fired when a vetoable property of the Bean is changed. |
Any VetoableChangeListener |
vetoableChange(PropertyChangeEvent) |
- See Also:
- Macro, MacroIOProvider
-
ADVRECORD_ENABLED
- AdvRecordEnabled property keyword.
-
BUTTON_TEXT_VISIBLE
- ButtonTextVisible property keyword.
-
MACRO_LIST
- MacroList property keyword.
-
RECORD_ENABLED
- RecordEnabled property keyword.
-
RECORD_UI
- RecordUI property keyword.
-
STATE
- State property keyword.
-
MacroManager()
- Constructs a MacroManager bean.
-
MacroManager(Macro)
- Constructs a MacroManager bean and sets the Macro bean contained by
MacroManager.
-
MacroManager(Properties)
- Constructs a MacroManager bean from a Properties object.
-
addMacroDebugListener(MacroDebugListener)
- Adds the given MacroDebugListener to list of listeners.
-
addMacroParseListener(MacroParseListener)
- Adds the given MacroParseListener to list of listeners.
-
addMacroRuntimeListener(MacroRuntimeListener)
- Adds the given MacroRuntimeListener to list of listeners.
-
clone()
- Returns a new instance of MacroManager with the same state as the current one.
-
getMacroBean()
- Returns the Macro object contained by MacroManager.
-
getMacroList()
- Returns the list of currently available macros.
-
getState()
- Returns the state of the current macro.
-
getTraceName()
- Returns a trace identifier for this bean
-
isAdvRecordEnabled()
- Returns MacroManager's advanced recording capabilities state.
-
isButtonTextVisible()
- Returns the text visibility state of the text in the buttons of MacroManager.
-
isRecordEnabled()
- Returns MacroManager's recording capabilities state.
-
isRecordUI()
- Returns whether the Macro will record user interface events on the
Terminal bean.
-
mouseEvent(ScreenMouseEvent)
- Screen mouse handler from Terminal.
-
pause()
- Toggles pause recording or playing the macro.
-
play()
- Toggles the play state of the current macro.
-
record()
- Starts recording a macro or resumes recording a paused macro.
-
removeMacroDebugListener(MacroDebugListener)
- Removes the given MacroDebugListener from list of listeners.
-
removeMacroIOProvider(MacroIOProvider)
- Removes the given MacroIOProvider from MacroManager.
-
removeMacroParseListener(MacroParseListener)
- Removes the given MacroParseListener from the list of listeners.
-
removeMacroRuntimeListener(MacroRuntimeListener)
- Removes the given MacroRuntimeListener from list of listeners.
-
setAdvRecordEnabled(boolean)
- Turns off/on MacroManager's advanced recording capabilities.
-
setButtonTextVisible(boolean)
- Sets the text visibility state of the text in the buttons of MacroManager.
-
setMacroBean(Macro)
- Sets the Macro object contained by MacroManager.
-
setMacroIOProvider(MacroIOProvider)
- Sets the given MacroIOProvider for MacroManager.
-
setMacroList(Vector)
- Sets the list of currently available macros.
-
setPrompts(MacroPrompts)
- Sets the macro prompts.
-
setRecordEnabled(boolean)
- Turns off/on MacroManager's recording capabilities.
-
setRecordUI(boolean)
- Sets whether the Macro will record user interface events on the
Terminal bean.
-
setSelectedMacro(String)
- Sets the macro with the given name to the current macro in MacroManger.
-
stop()
- Stops recording or playing the macro.
RECORD_ENABLED
public static final String RECORD_ENABLED
- RecordEnabled property keyword.
ADVRECORD_ENABLED
public static final String ADVRECORD_ENABLED
- AdvRecordEnabled property keyword.
STATE
public static final String STATE
- State property keyword.
MACRO_LIST
public static final String MACRO_LIST
- MacroList property keyword.
BUTTON_TEXT_VISIBLE
public static final String BUTTON_TEXT_VISIBLE
- ButtonTextVisible property keyword.
RECORD_UI
public static final String RECORD_UI
- RecordUI property keyword.
MacroManager
public MacroManager()
- Constructs a MacroManager bean.
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
MacroManager
public MacroManager(Properties p) throws PropertyVetoException
- Constructs a MacroManager bean from a Properties object.
- Throws: PropertyVetoException
- Thrown if error in setting property
mouseEvent
public synchronized void mouseEvent(ScreenMouseEvent evt)
- Screen mouse handler from Terminal.
getMacroBean
public Macro getMacroBean()
- Returns the Macro object contained by MacroManager.
- Returns:
- Macro object in the MacroManager object
setMacroBean
public void setMacroBean(Macro val) throws MacroException
- Sets the Macro object contained by MacroManager.
- Parameters:
- val - new Macro object for the MacroManager object
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
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
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
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
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 incorect parameter is passed or if Macro
experiences an internal error
- See Also:
- removeMacroParseListener
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
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
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
setRecordEnabled
public void setRecordEnabled(boolean rec) throws PropertyVetoException
- Turns off/on MacroManager's recording capabilities.
- Parameters:
- rec - If true, enables recording functions.
- Throws: PropertyVetoException
- Thrown if error in setting property
isRecordEnabled
public boolean isRecordEnabled()
- Returns MacroManager's recording capabilities state.
setAdvRecordEnabled
public void setAdvRecordEnabled(boolean advrec) throws PropertyVetoException
- Turns off/on MacroManager's advanced recording capabilities. 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
isAdvRecordEnabled
public boolean isAdvRecordEnabled()
- Returns MacroManager's advanced recording capabilities state.
getState
public int getState()
- Returns the state of the current macro. Returned value is one of the
Macro state constants.
- See Also:
- Macro
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
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.
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.
isButtonTextVisible
public boolean isButtonTextVisible()
- Returns the text visibility state of the text in the buttons of MacroManager.
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.
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.
clone
public synchronized Object clone()
- Returns a new instance of MacroManager with the same state as the current one.
- Overrides:
- clone in class HODPanelBean
setSelectedMacro
public synchronized void setSelectedMacro(String name) throws MacroException
- Sets the macro with the given name to the current macro in MacroManger. This
will cause MacroManager to call the getMacro(name) method on the connected
MacroIOProvider.
- Parameters:
- name - Name of macro to select.
record
public void record()
- Starts recording a macro or resumes recording a paused macro.
stop
public void stop()
- Stops recording or playing the macro.
play
public void play()
- Toggles the play state of the current macro.
pause
public void pause()
- Toggles pause recording or playing the macro.
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
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