|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdsto.dfc.swing.commands.AbstractCommand
dsto.dfc.swing.commands.AbstractMutableCommand
dsto.dfc.swing.commands.AbstractSelectionBasedCommand
dsto.dfc.swing.commands.AbstractMoveCommand
public abstract class AbstractMoveCommand
Base class for commands that move items up/down within their host.
Subclasses that support auto enable/disable should override
updateEnabled() and remember to call it from their
constructor.
| Field Summary | |
|---|---|
protected boolean |
direction
|
static boolean |
MOVE_DOWN
|
static Icon |
MOVE_DOWN_ICON
|
static boolean |
MOVE_UP
|
static Icon |
MOVE_UP_ICON
|
| Fields inherited from class dsto.dfc.swing.commands.AbstractSelectionBasedCommand |
|---|
source |
| Fields inherited from class dsto.dfc.swing.commands.AbstractMutableCommand |
|---|
listeners |
| Fields inherited from class dsto.dfc.swing.commands.AbstractCommand |
|---|
displayName, icon |
| Fields inherited from interface dsto.dfc.swing.icons.Iconic |
|---|
NULL_ICON |
| Constructor Summary | |
|---|---|
AbstractMoveCommand(SelectionEventSource client,
boolean direction)
Create a new instance. |
|
| Method Summary | |
|---|---|
abstract 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 |
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. |
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 |
isInteractive()
True if this command will interact with the user when execute() is called. |
void |
selectionChanged(SelectionEvent e)
SelectionListener interface implementation: does nothing. |
protected void |
updateEnabled()
Override this to update the enabled property appopriately. |
| Methods inherited from class dsto.dfc.swing.commands.AbstractSelectionBasedCommand |
|---|
dispose |
| Methods inherited from class dsto.dfc.swing.commands.AbstractMutableCommand |
|---|
addPropertyChangeListener, clone, isEnabled, removePropertyChangeListener, setEnabled, setIcon |
| Methods inherited from class dsto.dfc.swing.commands.AbstractCommand |
|---|
actionPerformed, canReplace, getDefaultDisplayName, getDisplayName, getLargeIcon, getLogString, setDisplayName |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Icon MOVE_UP_ICON
public static final Icon MOVE_DOWN_ICON
public static final boolean MOVE_UP
public static final boolean MOVE_DOWN
protected boolean direction
| Constructor Detail |
|---|
public AbstractMoveCommand(SelectionEventSource client,
boolean direction)
client - The client of the command.direction - The direction to move the entries (MOVE_UP or
MOVE_DOWN).| Method Detail |
|---|
public abstract void execute()
Command
execute in interface Commandexecute in class AbstractCommandpublic String getName()
Command
getName in interface CommandgetName in interface IconicgetName in class AbstractCommandpublic Icon getIcon()
Iconic
getIcon in interface IconicgetIcon in class AbstractCommandpublic String getDescription()
Command
getDescription in interface CommandgetDescription in class AbstractCommandpublic boolean isInteractive()
Command
isInteractive in interface CommandisInteractive in class AbstractCommandpublic 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 CommandgetGroupInView in class AbstractCommandviewName - The name of the view.
public char getMnemonic()
Command
getMnemonic in interface CommandgetMnemonic in class AbstractCommandpublic KeyStroke getAccelerator()
Command
getAccelerator in interface CommandgetAccelerator in class AbstractCommandpublic void selectionChanged(SelectionEvent e)
AbstractSelectionBasedCommand
selectionChanged in interface SelectionListenerselectionChanged in class AbstractSelectionBasedCommandprotected void updateEnabled()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||