|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.as400.ui.util.CommandPrompter
public class CommandPrompter extends Object
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
}
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
CommandPrompter()
Constructs a CommandPrompter object. |
CommandPrompter(Frame parent,
AS400 system,
String commandString)
Constructs a CommandPrompter object. |
CommandPrompter(Frame parent,
AS400 system,
String commandString,
boolean usePromptPrograms,
boolean promptInteractiveCommands)
Constructs a CommandPrompter object. |
CommandPrompter(Window parent,
AS400 system,
String commandString)
Constructs a CommandPrompter object. |
CommandPrompter(Window parent,
AS400 system,
String commandString,
boolean usePromptPrograms,
boolean promptInteractiveCommands)
Constructs a CommandPrompter object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener to be notified when the value of any bound property changes. |
void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a listener to be notified when the value of any constrained property changes. |
String |
getCommandString()
Returns the prompted command string. |
int |
getDateFormat()
Returns the date format used during prompting. |
Window |
getParent()
Returns the parent Frame or Dialog 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(PropertyChangeListener listener)
Removes a property change listener. |
void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable change listener. |
void |
setCommandString(String command)
Sets the command string to be prompted. |
void |
setParent(Window 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. |
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(Frame parent,
AS400 system,
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(Frame parent,
AS400 system,
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.
public CommandPrompter(Window parent,
AS400 system,
String commandString)
CommandPrompter object.
parent - The parent window that displays the dialog.system - The AS/400 system used to retrieve the command definition.commandString - The command string to be prompted.
public CommandPrompter(Window parent,
AS400 system,
String commandString,
boolean usePromptPrograms,
boolean promptInteractiveCommands)
CommandPrompter object.
parent - The parent window 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(PropertyChangeListener listener)
public void addVetoableChangeListener(VetoableChangeListener listener)
public String getCommandString()
public int getDateFormat()
public Window getParent()
public boolean getPromptInteractiveCommands()
setPromptInteractiveCommands(boolean)public AS400 getSystem()
public boolean getUsePromptPrograms()
setUsePromptPrograms(boolean)public boolean isBatch()
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removeVetoableChangeListener(VetoableChangeListener listener)
public void setCommandString(String command)
command - The command string to be prompted.public void setParent(Window parent)
parent - The parent Frame for the CommandPrompter dialog.
public void setPromptInteractiveCommands(boolean prompt)
throws PropertyVetoException
prompt - Specifies if the prompter should also prompt interactive commands.PropertyVetoExceptiongetPromptInteractiveCommands()public void setSystem(AS400 system)
system - The AS/400 system to use to retrieve the command definition.
public void setUsePromptPrograms(boolean usePromptPrograms)
throws PropertyVetoException
usePromptPrograms - true to allow the prompt override and change exit programs to be
called for the command, false otherwise.PropertyVetoExceptiongetUsePromptPrograms()public int showDialog()
OK,
CANCEL,
ERROR,
PTF_REQUIREDpublic int showHelp()
OK,
ERROR,
PTF_REQUIREDpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||