|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.util.CommandPrompter
This object displays a prompter for a given command string similar
to the prompting done by the AS/400 command line. The command string
may be a command name, a full command string, or a partial command name
such as crt*. Any errors encountered during prompting will be handled
by the CommandPrompter. The prompter requires the AS/400 system to be
at release V4R4 or later.
Usage:
AS400 system = new AS400("system1"); CommandPrompter cp = new CommandPrompter(frame, system, "savlib");
if(cp.showDialog() == CommandPrompter.OK) { result = cp.getCommandString(); // get command string }
Field Summary | |
static int |
CANCEL
The user dismissed the dialog by pressing the Cancel button. |
static int |
DATE_DAY_MONTH_YEAR
Constant specifying the date format is day, month, and year. |
static int |
DATE_JULIAN
Constant specifying the date format is Julian. |
static int |
DATE_MONTH_DAY_YEAR
Constant specifying the date format is month, day, and year. |
static int |
DATE_NONE
Constant specifying a date format was not used by the command. |
static int |
DATE_YEAR_MONTH_DAY
Constant specifying the date format is year, month, and day. |
static int |
ERROR
The dialog was dismissed due to an error during prompting. |
static int |
OK
The user dismissed the dialog by pressing the OK button. |
static int |
PTF_REQUIRED
The host system requires a PTF for the prompter to function. |
Constructor Summary | |
CommandPrompter()
Constructs a CommandPrompter object. |
|
CommandPrompter(java.awt.Frame parent,
AS400 system,
java.lang.String commandString)
Constructs a CommandPrompter object. |
|
CommandPrompter(java.awt.Frame parent,
AS400 system,
java.lang.String commandString,
boolean usePromptPrograms,
boolean promptInteractiveCommands)
Constructs a CommandPrompter object. |
Method Summary | |
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes. |
void |
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes. |
java.lang.String |
getCommandString()
Returns the prompted command string. |
int |
getDateFormat()
Returns the date format used during prompting. |
java.awt.Frame |
getParent()
Returns the parent Frame for the CommandPrompter dialog. |
boolean |
getPromptInteractiveCommands()
Gets whether the CommandPrompter should prompt interactive commands in addition to batch commands. |
AS400 |
getSystem()
Returns the system used by this dialog. |
boolean |
getUsePromptPrograms()
Returns if the prompter should call the prompt override and change exit programs. |
boolean |
isBatch()
Returns if the command prompted could be executed in batch. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener. |
void |
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes a vetoable change listener. |
void |
setCommandString(java.lang.String command)
Sets the command string to be prompted. |
void |
setParent(java.awt.Frame parent)
Sets the parent Frame for the CommandPrompter dialog. |
void |
setPromptInteractiveCommands(boolean prompt)
Sets whether the prompter should prompt interactive commands in addition to batch commands. |
void |
setSystem(AS400 system)
Sets the AS/400 system used to retrieve the command definition. |
void |
setUsePromptPrograms(boolean usePromptPrograms)
Sets whether the prompter should call the prompt override and change exit programs for the command. |
int |
showDialog()
Shows the dialog and returns how it was dismissed. |
int |
showHelp()
Show the help window for the command without prompting. |
java.lang.String |
toString()
Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OK
public static final int CANCEL
public static final int ERROR
public static final int PTF_REQUIRED
public static final int DATE_NONE
public static final int DATE_DAY_MONTH_YEAR
public static final int DATE_JULIAN
public static final int DATE_MONTH_DAY_YEAR
public static final int DATE_YEAR_MONTH_DAY
Constructor Detail |
public CommandPrompter()
CommandPrompter
object.
public CommandPrompter(java.awt.Frame parent, AS400 system, java.lang.String commandString)
CommandPrompter
object.
parent
- The parent Frame that displays the dialog.system
- The AS/400 system used to retrieve the command definition.commandString
- The command string to be prompted.public CommandPrompter(java.awt.Frame parent, AS400 system, java.lang.String commandString, boolean usePromptPrograms, boolean promptInteractiveCommands)
CommandPrompter
object.
parent
- The parent Frame that displays the dialog.system
- The AS/400 system used to retrieve the command definition.commandString
- The command string to be prompted.usePromptPrograms
- If the prompt override and change exit programs should be called for the command.promptInteractiveCommands
- If the prompter should prompt interactive commands.Method Detail |
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
public java.lang.String getCommandString()
public int getDateFormat()
public java.awt.Frame getParent()
public boolean getPromptInteractiveCommands()
setPromptInteractiveCommands(boolean)
public AS400 getSystem()
public boolean getUsePromptPrograms()
setUsePromptPrograms(boolean)
public boolean isBatch()
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
public void setCommandString(java.lang.String command)
command
- The command string to be prompted.public void setParent(java.awt.Frame parent)
parent
- The parent Frame for the CommandPrompter dialog.public void setPromptInteractiveCommands(boolean prompt) throws java.beans.PropertyVetoException
prompt
- Specifies if the prompter should also prompt interactive commands.getPromptInteractiveCommands()
public void setSystem(AS400 system)
system
- The AS/400 system to use to retrieve the command definition.public void setUsePromptPrograms(boolean usePromptPrograms) throws java.beans.PropertyVetoException
usePromptPrograms
- true to allow the prompt override and change exit programs to be
called for the command, false otherwise.getUsePromptPrograms()
public int showDialog()
OK
,
CANCEL
,
ERROR
,
PTF_REQUIRED
public int showHelp()
OK
,
ERROR
,
PTF_REQUIRED
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |