|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
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 Command
public abstract String getName()
Command
getName
in interface Command
getName
in interface Iconic
public abstract String getDescription()
Command
getDescription
in interface Command
public abstract boolean isInteractive()
Command
isInteractive
in interface Command
public abstract String getGroupInView(String viewName)
Command
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.
getGroupInView
in interface Command
viewName
- The name of the view.
public abstract char getMnemonic()
Command
getMnemonic
in interface Command
public KeyStroke getAccelerator()
Command
getAccelerator
in interface Command
public String getDisplayName()
Command
getDisplayName
in interface Command
public void setDisplayName(String newDisplayName)
protected String getDefaultDisplayName()
public String getLogString()
getLogString
in interface Command
public boolean isEnabled()
isEnabled
in interface Command
public boolean canReplace(Command command)
canReplace
in interface Command
public Icon getIcon()
Iconic
getIcon
in interface Iconic
public void setIcon(Icon newIcon)
public Icon getLargeIcon()
Iconic
getLargeIcon
in interface Iconic
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public Object clone()
Copyable
NOTE: 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 Copyable
clone
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |