|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdsto.dfc.swing.commands.AbstractCommand
public abstract class AbstractCommand
Base class for commands. Provides default implementations for some methods.
| Field Summary | |
|---|---|
protected String |
displayName
|
protected Icon |
icon
|
| Fields inherited from interface dsto.dfc.swing.icons.Iconic |
|---|
NULL_ICON |
| Constructor Summary | |
|---|---|
AbstractCommand()
|
|
AbstractCommand(String iconName)
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
|
boolean |
canReplace(Command command)
Returns false; |
Object |
clone()
Create a completely separate copy of this object and any mutable objects owned by the object. |
abstract void |
execute()
Execute the command. |
KeyStroke |
getAccelerator()
Get a keyboard accelerator for the command. |
protected String |
getDefaultDisplayName()
Generates a display name based on the last component of the command name. |
abstract 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). |
abstract String |
getGroupInView(String viewName)
Get the preferred group that this command should appear in for a given view. |
Icon |
getIcon()
The small (16x16) icon for the object. |
Icon |
getLargeIcon()
The large (32x32) icon. |
String |
getLogString()
Returns the command name followed by empty brackets. |
abstract char |
getMnemonic()
Get a character shortcut for the command (eg for use on a menu). |
abstract String |
getName()
The formal identifying name for this command (eg edit.Copy, file.Open). |
boolean |
isEnabled()
Returns true. |
abstract boolean |
isInteractive()
True if this command will interact with the user when execute() is called. |
void |
setDisplayName(String newDisplayName)
|
void |
setIcon(Icon newIcon)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Icon icon
protected String displayName
| Constructor Detail |
|---|
public AbstractCommand()
public AbstractCommand(String iconName)
| Method Detail |
|---|
public abstract void execute()
Command
execute in interface Commandpublic abstract String getName()
Command
getName in interface CommandgetName in interface Iconicpublic abstract String getDescription()
Command
getDescription in interface Commandpublic abstract boolean isInteractive()
Command
isInteractive in interface Commandpublic abstract String getGroupInView(String viewName)
CommandIf 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.
getGroupInView in interface CommandviewName - The name of the view.
public abstract char getMnemonic()
Command
getMnemonic in interface Commandpublic KeyStroke getAccelerator()
Command
getAccelerator in interface Commandpublic String getDisplayName()
Command
getDisplayName in interface Commandpublic void setDisplayName(String newDisplayName)
protected String getDefaultDisplayName()
public String getLogString()
getLogString in interface Commandpublic boolean isEnabled()
isEnabled in interface Commandpublic boolean canReplace(Command command)
canReplace in interface Commandpublic Icon getIcon()
Iconic
getIcon in interface Iconicpublic void setIcon(Icon newIcon)
public Icon getLargeIcon()
Iconic
getLargeIcon in interface Iconicpublic void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerpublic Object clone()
CopyableNOTE: subclasses should not remove the CloneNotSupportedException throws clause if they themselves support subclassing: removing the CloneNotSupportedException declaration stops subclasses from indicating that a clone was not possible.
clone in interface Copyableclone in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||