|
||||||||||
| 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.AbstractEnumeratedCommand
public abstract class AbstractEnumeratedCommand
Abstract base class for commands that act to select one or more values from an enumerated set (eg zoom levels, open windows, etc). Provides an implementation of CustomMenuProvider (via delegation to EnumeratedCmdMenuSynchronizer) that generates an appropriate set of menu items for selecting the available enumerated values.
| Field Summary |
|---|
| 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 | |
|---|---|
AbstractEnumeratedCommand()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Custom menu providers should fire change events when the menu UI needs to be updated. |
List |
createMenuItems()
Create the menu items that represent the UI for the command. |
void |
destroyMenuItems(List items)
Destroy menu items created by createMenuItems (). |
abstract void |
execute()
Execute the command. |
abstract String |
getDescription()
A short description of the command, suitable for a tooltip or use in a status panel. |
abstract EnumerationValue[] |
getEnumValues()
Get the list of values within the enumeration. |
abstract String |
getGroupInView(String viewName)
Get the preferred group that this command should appear in for a given view. |
abstract int |
getMaxSelectedValues()
Get the maximum number of values that may be selected at any one time. |
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). |
abstract Object[] |
getNextSelectedValues()
Get the values that will be set by executing the command. |
abstract Object[] |
getSelectedValues()
The currently selected values. |
abstract boolean |
isInteractive()
True if this command will interact with the user when execute() is called. |
boolean |
isSelected(Object value)
|
void |
removeChangeListener(ChangeListener l)
|
abstract void |
setNextSelectedValues(Object[] values)
Set the values that will be 'selected' when execute() is next called (this is usually called immediately before execute() by an action listener attached to the appropriate menu item). |
| 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, getAccelerator, getDefaultDisplayName, getDisplayName, getIcon, getLargeIcon, getLogString, setDisplayName |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface dsto.dfc.swing.commands.Command |
|---|
canReplace, getAccelerator, getDisplayName, getLogString, isEnabled |
| Methods inherited from interface dsto.dfc.swing.icons.Iconic |
|---|
getIcon, getLargeIcon |
| Methods inherited from interface dsto.dfc.util.PropertyEventSource |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Constructor Detail |
|---|
public AbstractEnumeratedCommand()
| Method Detail |
|---|
public boolean isSelected(Object value)
public abstract EnumerationValue[] getEnumValues()
EnumerationValue
getEnumValues in interface EnumerationValuepublic abstract void setNextSelectedValues(Object[] values)
EnumeratedCommand
setNextSelectedValues in interface EnumeratedCommandEnumeratedCommand.getMaxSelectedValues()public abstract Object[] getNextSelectedValues()
EnumeratedCommand
getNextSelectedValues in interface EnumeratedCommandEnumeratedCommand.setNextSelectedValues(java.lang.Object[])public abstract Object[] getSelectedValues()
EnumeratedCommand
getSelectedValues in interface EnumeratedCommandpublic abstract int getMaxSelectedValues()
EnumeratedCommand
getMaxSelectedValues in interface EnumeratedCommandEnumeratedCommand.setNextSelectedValues(java.lang.Object[])public abstract void execute()
Command
execute in interface Commandexecute in class AbstractCommandpublic abstract String getName()
Command
getName in interface CommandgetName in interface IconicgetName in class AbstractCommandpublic abstract String getDescription()
Command
getDescription in interface CommandgetDescription in class AbstractCommandpublic abstract boolean isInteractive()
Command
isInteractive in interface CommandisInteractive in class AbstractCommandpublic 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 CommandgetGroupInView in class AbstractCommandviewName - The name of the view.
public abstract char getMnemonic()
Command
getMnemonic in interface CommandgetMnemonic in class AbstractCommandpublic List createMenuItems()
CustomMenuProvider
createMenuItems in interface CustomMenuProviderpublic void destroyMenuItems(List items)
CustomMenuProvider
destroyMenuItems in interface CustomMenuProviderpublic void removeChangeListener(ChangeListener l)
removeChangeListener in interface CustomMenuProviderpublic void addChangeListener(ChangeListener l)
CustomMenuProvider
addChangeListener in interface CustomMenuProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||