dsto.dfc.swing.commands
Interface Command

All Superinterfaces:
Iconic
All Known Subinterfaces:
CompositeCommand, EnumeratedCommand
All Known Implementing Classes:
AbstractAddRowCommand, AbstractBooleanCommand, AbstractCnpCommand, AbstractCommand, AbstractCompositeCommand, AbstractCustomizeRowCommand, AbstractEnumeratedCommand, AbstractMoveCommand, AbstractMutableCommand, AbstractSelectionBasedCommand, AbstractShowCustomizerCommand, AbstractUndoableCommand, BasicAboutCommand, BasicAddEntryCommand, BasicCopyCommand, BasicCutCommand, BasicDeleteCommand, BasicDocumentSaveAsCommand, BasicDocumentSaveCommand, BasicExitCommand, BasicFileOpenCommand, BasicFileSaveAsCommand, BasicFileSaveCommand, BasicPasteCommand, BasicPropertiesCommand, BasicSerializeCommand, CmdAddEntry, CmdAddRow, CmdClosePanel, CmdCollapse, CmdCopy, CmdCustomize, CmdCustomize, CmdCut, CmdDelete, CmdDeleteRow, CmdDeleteRows, CmdExpandAll, CmdFloatPanel, CmdInsertRow, CmdMoveEntry, CmdMoveRow, CmdPageLayoutPanel, CmdPaste, CmdPrintPanel, CmdPrintPreviewPanel, CmdRedo, CmdRedoTo, CmdRename, CmdSelectAll, CmdShowLogWindow, CmdUndo, CmdUndoTo, DfcDialog.CmdCancel, MapTableView.CmdAddProperty, MapTableView.CmdDeleteProperty, StyleSheetTableView.CmdClearValue

public interface Command
extends Iconic

Defines a command that may be executed by the user.

Version:
$Revision$

Field Summary
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Method Summary
 boolean canReplace(Command command)
          True if this command can logically replace another.
 void execute()
          Execute the command.
 KeyStroke 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.
 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.
 
Methods inherited from interface dsto.dfc.swing.icons.Iconic
getIcon, getLargeIcon
 

Method Detail

execute

void execute()
Execute the command.


getName

String getName()
The formal identifying name for this command (eg edit.Copy, file.Open). This must not change during the lifetime of a command instance.

Specified by:
getName in interface Iconic

getDisplayName

String getDisplayName()
The name of the command as it should be displayed (eg on a menu). May be null in which case the command name (or some derivative) will be used.


getDescription

String getDescription()
A short description of the command, suitable for a tooltip or use in a status panel.


getLogString

String getLogString()
A string that is suitable to describe this command and its parameters for logging purposes.


isEnabled

boolean isEnabled()
True if the command is enabled, ie able to execute in the current context.


isInteractive

boolean isInteractive()
True if this command will interact with the user when execute() is called.


getGroupInView

String getGroupInView(String viewName)
Get the preferred group that this command should appear in for a given view. This may be overridden by a setting in the CommandRegistry.

If the command changes its group in any view it should generate a groupInView property change event with the old value set to the old group and the new value set to the new group.

Parameters:
viewName - The name of the view.
Returns:
The group in the view, or null if this command does not appear in the given view.

canReplace

boolean canReplace(Command command)
True if this command can logically replace another. Used during command merging.


getMnemonic

char getMnemonic()
Get a character shortcut for the command (eg for use on a menu). May return 0 for no mnemonic.


getAccelerator

KeyStroke getAccelerator()
Get a keyboard accelerator for the command. May return null for no accelerator.



Copyright © 2008 Commonwealth of Australia