dsto.dfc.swing.commands
Class AbstractBooleanCommand
java.lang.Object
dsto.dfc.swing.commands.AbstractCommand
dsto.dfc.swing.commands.AbstractMutableCommand
dsto.dfc.swing.commands.AbstractBooleanCommand
- All Implemented Interfaces:
- Command, CustomMenuProvider, CustomToolBarProvider, Iconic, Copyable, PropertyEventSource, ActionListener, Cloneable, EventListener
public abstract class AbstractBooleanCommand
- extends AbstractMutableCommand
- implements CustomMenuProvider, CustomToolBarProvider
Base class for commands that can be 'on' or 'off'. Provides custom
checkbox menu item creation to show command state.
- Version:
- $Revision$
Methods inherited from class dsto.dfc.swing.commands.AbstractCommand |
actionPerformed, canReplace, execute, getAccelerator, getDefaultDisplayName, getDescription, getDisplayName, getGroupInView, getIcon, getLargeIcon, getLogString, getMnemonic, getName, isInteractive, setDisplayName |
AbstractBooleanCommand
public AbstractBooleanCommand()
AbstractBooleanCommand
public AbstractBooleanCommand(String iconName)
getValue
public boolean getValue()
setValue
public void setValue(boolean newValue)
createMenuItems
public List createMenuItems()
- Description copied from interface:
CustomMenuProvider
- Create the menu items that represent the UI for the command.
- Specified by:
createMenuItems
in interface CustomMenuProvider
- Returns:
- A new list of JComponent's to be added to the menu for
the command.
destroyMenuItems
public void destroyMenuItems(List items)
- Description copied from interface:
CustomMenuProvider
- Destroy menu items created by createMenuItems ().
- Specified by:
destroyMenuItems
in interface CustomMenuProvider
createToolBarComponent
public JComponent createToolBarComponent()
- Description copied from interface:
CustomToolBarProvider
- Create the Component that represent the UI for the command.
- Specified by:
createToolBarComponent
in interface CustomToolBarProvider
- Returns:
- A new Component to be added to the ToolBar for the command.
destroyToolBarComponent
public void destroyToolBarComponent(JComponent component)
- Description copied from interface:
CustomToolBarProvider
- Destroy the Component created by createToolBarComponent ().
- Specified by:
destroyToolBarComponent
in interface CustomToolBarProvider
addChangeListener
public void addChangeListener(ChangeListener l)
- Description copied from interface:
CustomMenuProvider
- Custom menu providers should fire change events when the menu UI
needs to be updated. This event will trigger any interested
listeners to destroy old menu items (destroyMenuItems ()) and
create new ones (createMenuItems ()).
- Specified by:
addChangeListener
in interface CustomMenuProvider
- Specified by:
addChangeListener
in interface CustomToolBarProvider
removeChangeListener
public void removeChangeListener(ChangeListener l)
- Specified by:
removeChangeListener
in interface CustomMenuProvider
- Specified by:
removeChangeListener
in interface CustomToolBarProvider
Copyright © 2008 Commonwealth of Australia