protected class App.AppCommandEnv extends CommandEnv implements Console
Console.MessageType
commandRegistry, console, navigationHistory, systemSelection, userPreferences, xmlClipboard
properties
Constructor and Description |
---|
AppCommandEnv() |
Modifier and Type | Method and Description |
---|---|
Console |
getConsole()
Returns the console.
|
Component |
getDialogParent(Component component)
Returns the parent of the dialog to be created by a command.
|
Preferences |
getUserPreferences()
Returns the user preferences.
|
void |
showMessage(String message,
Console.MessageType messageType)
Show specified message to user.
|
void |
showStatus(Component component,
String message,
boolean autoErase)
Displays specified message in the status window corresponding
to specified panel.
|
getCommandRegistry, getNavigationHistory, getSharedInstance, getSystemProperty, getSystemSelection, getXMLClipboard, invokeLater, reportError, reportInfo, reportWarning, setSharedInstance, setSystemProperty, showError, showInfo, showStatus, showWarning
getProperties, getProperty, getPropertyCount, hasProperty, putProperties, putProperty, removeAllProperties, removeProperty
public Preferences getUserPreferences()
CommandEnv
getUserPreferences
in class CommandEnv
public Console getConsole()
CommandEnv
getConsole
in class CommandEnv
public Component getDialogParent(Component component)
CommandEnv
null
, in which case the command is expected to
be executed non-interactively.getDialogParent
in class CommandEnv
component
- any component which is a descendant of
current active Window; for example the panel hosting the gadget tree.
The default implementation uses this parameter but
some implementations may ignore it. In such case,
it is possible to pass null
.
public void showStatus(Component component, String message, boolean autoErase)
CommandEnv
showStatus
in class CommandEnv
component
- any component which is a descendant of
current active Window; for example the panel hosting the gadget tree.
The default implementation uses this parameter but
some implementations may ignore it. In such case,
it is possible to pass null
.
message
- the message to be displayed; may be null
or
empty in which case the message area is immediately clearedautoErase
- if true
, instruct the application to
automatically erase the message after a few secondspublic void showMessage(String message, Console.MessageType messageType)
Console
showMessage
in interface Console
message
- a possibly multi-line messagemessageType
- type of message: Console.MessageType.INFO
, Console.MessageType.WARNING
, Console.MessageType.ERROR
or Console.MessageType.DEBUG
.