All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.eNetwork.beans.HOD.MacroPrompts
java.lang.Object
|
+----com.ibm.eNetwork.beans.HOD.MacroPrompts
- public class MacroPrompts
- extends Object
- implements ECLConstants
MacroPrompts class contains functionality for iterating through and
setting prompt values fired in a MacroPromptEvent.
When the macro runs it will be scanned for all prompt lines. Each new prompt
identifier will be loaded into an object of the MacroPrompts class. This
object will then be fired in a MacroPromptEvent, whereby a listener should set
all values in the MacroPrompts object. After the object is set, the listener
should call setPrompts on Macro to play the macro after prescan. If a value was
not set, and there is a value specified on the prompt line, that value will
be used. If there is no value on the prompt line, another event will be
fired to try to retrieve the prompt data. If still no data is returned,
the macro will end in an error.
- See Also:
- MacroPromptEvent, Macro
-
MacroPrompts(Macro)
- Constructs an instance of a prompt collection object.
-
add(int, MacroActionPrompt)
- Inserts the macro prompt action at the given index.
-
add(MacroActionPrompt)
- Appends the macro prompt action to the end of the collection.
-
clear()
- Removes all macro prompt actions from the collection
-
clearPromptValues()
- Removes all prompt values
-
contains(MacroActionPrompt)
- Tests to see if given macro prompt action is in the collection.
-
get(int)
- Returns the macro prompt action at the given index
-
getNumPrompts()
- Returns the number of prompts in the MacroPrompts object.
Deprecated.
-
getPromptDefault(String)
- Gets the default value of a prompt using a prompt name.
-
getPromptName(int)
- Gets the name of a prompt at a given index.
-
getPromptValue(String)
- Gets the value of a prompt using a prompt name.
-
indexOf(MacroActionPrompt)
- Returns the index of the given macro prompt action.
-
isEmpty()
- Tests to see if the macro prompt action collection is empty.
-
isPromptPassword(String)
- Returns whether a prompt is a password display using a prompt name.
-
remove(int)
- Removes the macro prompt action at the given index from the collection.
-
remove(MacroActionPrompt)
- Removes the given macro prompt action from the collection.
-
set(MacroActionPrompt, int)
- Replaces the macro prompt action object at the given index in the collection.
-
setPromptValue(String, String)
- Sets the value of a prompt using a prompt name.
-
size()
- Returns the number of actions in the macro prompt action collection.
MacroPrompts
public MacroPrompts(Macro mac)
- Constructs an instance of a prompt collection object.
- Parameters:
- mac - Macro object that owns the prompts
get
public MacroActionPrompt get(int argIndex)
- Returns the macro prompt action at the given index
- Parameters:
- argIndex - index for the MacroAction object
- Returns:
- MacroActionPrompt object at the given index
set
public void set(MacroActionPrompt argMA,
int argIndex)
- Replaces the macro prompt action object at the given index in the collection.
- Parameters:
- argMA - MacroActionPrompt object to place in collection
- argIndex - index for the MacroActionPrompt object
add
public void add(MacroActionPrompt argMA)
- Appends the macro prompt action to the end of the collection. If
a prompt is already in the collection with the same name, the existing
prompt will be removed and the new one will be saved.
- Parameters:
- argMA - MacroActionPrompt object to place in collection
add
public void add(int argIndex,
MacroActionPrompt argMA)
- Inserts the macro prompt action at the given index. All succeeding macro
prompt actions will be shifted down in the collection. If
a prompt is already in the collection with the same name, the existing
prompt will be removed and the new one will be saved.
- Parameters:
- argMA - MacroActionPrompt object to place in collection
- argIndex - index for the MacroActionPrompt object
contains
public boolean contains(MacroActionPrompt argMA)
- Tests to see if given macro prompt action is in the collection.
- Parameters:
- argMA - MacroActionPrompt object to place in collection
- Returns:
- true if MacroActionPrompt object is in the collection, false otherwise
isEmpty
public boolean isEmpty()
- Tests to see if the macro prompt action collection is empty.
- Returns:
- true if collection is empty, false otherwise
size
public int size()
- Returns the number of actions in the macro prompt action collection.
- Returns:
- number of actions in the collection
clear
public void clear()
- Removes all macro prompt actions from the collection
remove
public void remove(MacroActionPrompt argMA)
- Removes the given macro prompt action from the collection.
- Parameters:
- argMA - MacroActionPrompt object to remove from the collection
remove
public void remove(int argIndex)
- Removes the macro prompt action at the given index from the collection.
- Parameters:
- argIndex - index for the MacroActionPrompt object to remove
indexOf
public int indexOf(MacroActionPrompt argMA)
- Returns the index of the given macro prompt action.
- Parameters:
- argMA - MacroActionPrompt object to find index of
- Returns:
- index of the MacroActionPrompt object, -1 if object is not in collection
getPromptName
public String getPromptName(int i)
- Gets the name of a prompt at a given index.
- Parameters:
- i - Index for name
- Returns:
- String Name of the prompt if valid index, null if invalid index.
getPromptDefault
public String getPromptDefault(String name)
- Gets the default value of a prompt using a prompt name. When Macro populates
the MacroPrompts object by scanning the macro at runtime, the first
default value is used if there are multiple instances of prompts with the
same name.
- Parameters:
- name - Name of the prompt
- Returns:
- String Prompt default value. Returns null if no name matches.
- See Also:
- MacroPromptEvent
getPromptValue
public String getPromptValue(String name)
- Gets the value of a prompt using a prompt name. The method returns the value
of the prompt associated with the given name, if there is one. The value
could be set using setPromptValue.
- Parameters:
- name - Name of the prompt
- Returns:
- String Prompt value. Returns null if no name matches or the
value on the prompt was null
- See Also:
- setPromptValue, MacroActionPrompt
setPromptValue
public void setPromptValue(String name,
String value)
- Sets the value of a prompt using a prompt name. This method could be used in
conjunction with the setPrompts method on MacroPromptEvent to make the new
value effective on the currently playing macro.
- Parameters:
- name - Name of the prompt
- value - Value of the prompt to set
- See Also:
- setPrompts
isPromptPassword
public boolean isPromptPassword(String name)
- Returns whether a prompt is a password display using a prompt name.
- Parameters:
- name - Name of the prompt
- Returns:
- boolean true if prompt should be displayed as password, false
otherwise.
clearPromptValues
public void clearPromptValues()
- Removes all prompt values
getNumPrompts
public int getNumPrompts()
- Note: getNumPrompts() is deprecated.
- Returns the number of prompts in the MacroPrompts object.
- See Also:
- size
All Packages Class Hierarchy This Package Previous Next Index