|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Command
Defines a command that may presented in a UI. Most commands will extend
AbstractCommand
.
AbstractCommand
Method Summary | |
---|---|
void |
addCommandListener(CommandListener l)
|
void |
execute()
Execute the command. |
int |
getAccelerator()
Get a keyboard accelerator for the command. |
String |
getDescription()
A short description of the command, suitable for a tooltip or use in a status panel. |
String |
getDisplayName()
The name of the command as it should be displayed (eg on a menu). |
String |
getGroupInView(String viewName)
Get the preferred group that this command should appear in for a given view. |
Icon |
getIcon()
The symbolic icon for the command. |
String |
getLogString()
A string that is suitable to describe this command and its parameters for logging purposes. |
char |
getMnemonic()
Get a character shortcut for the command (eg for use on a menu). |
String |
getName()
The formal identifying name for this command (eg edit.Copy, file.Open). |
boolean |
isEnabled()
True if the command is enabled, ie able to execute in the current context. |
boolean |
isInteractive()
True if this command will interact with the user when execute () is called. |
void |
removeCommandListener(CommandListener l)
|
void |
setAccelerator(int newAccelerator)
|
void |
setContextMenuGroup(String newContextMenuGroup)
Sets the group that command appears in context menus. |
void |
setDescription(String newDescription)
Sets the description. |
void |
setDisplayName(String newDisplayName)
|
void |
setEnabled(boolean newValue)
|
void |
setIcon(Icon newIcon)
|
void |
setMainMenuGroup(String newMainMenuGroup)
Sets the group that command appears in the main menu. |
void |
setMnemonic(char newMnemonic)
Sets the mnemonic. |
void |
setToolbarGroup(String newToolbarGroup)
Sets the group that command appears in toolbars. |
Methods inherited from interface dsto.dfc.util.PropertyEventSource |
---|
addPropertyChangeListener, removePropertyChangeListener |
Method Detail |
---|
void execute()
CommandListener.commandExecuted(CommandEvent)
when executed.
Icon getIcon()
String getName()
String getDisplayName()
String getDescription()
String getLogString()
boolean isEnabled()
boolean isInteractive()
String getGroupInView(String viewName)
NOTE: groups may be overridden by a setting in the CommandRegistry.
If the command changes its group it should generate a property change event with the property name the name of the view, the old value set to the old group and the new value set to the new group.
viewName
- The name of the view.
char getMnemonic()
int getAccelerator()
void setDisplayName(String newDisplayName)
void setIcon(Icon newIcon)
void setEnabled(boolean newValue)
void setAccelerator(int newAccelerator)
void setMnemonic(char newMnemonic)
newMnemonic
- The mnemonic to setvoid setContextMenuGroup(String newContextMenuGroup)
getGroupInView(String)
void setToolbarGroup(String newToolbarGroup)
getGroupInView(String)
void setMainMenuGroup(String newMainMenuGroup)
getGroupInView(String)
void setDescription(String newDescription)
newDescription
- The description to setvoid addCommandListener(CommandListener l)
void removeCommandListener(CommandListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |