dsto.dfc.swt.util
Class CmdToggleDataBeanProperty

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
      extended by dsto.dfc.swt.commands.AbstractCommand
          extended by dsto.dfc.swt.util.CmdToggleDataBeanProperty
All Implemented Interfaces:
PropertyListener, Command, CustomMenuCommand, CustomToolbarCommand, Copyable, Disposable, JavaBean, PropertyEventSource, Serializable, Cloneable, EventListener

public class CmdToggleDataBeanProperty
extends AbstractCommand
implements CustomMenuCommand, CustomToolbarCommand, PropertyListener, Disposable

Command that toggles a boolean property of an IDataBean.

Version:
$Revision$
See Also:
Serialized Form

Field Summary
 
Fields inherited from class dsto.dfc.swt.commands.AbstractCommand
NO_ICON
 
Constructor Summary
CmdToggleDataBeanProperty(IDataBean bean, String property, String name, String iconName, String group, String description, char mnemonic, int accelerator)
           
 
Method Summary
 CommandMenuItemProvider createMenuProvider(CommandView commandView, org.eclipse.swt.widgets.Menu menu, int index)
          Create a menu UI provider for the command.
 CommandToolbarItemProvider createToolbarProvider(CommandView commandView, org.eclipse.swt.widgets.ToolBar toolbar, int index)
          Create a toolbarUI provider for the command.
 void dispose()
          Dispose of the object (unregister listeners, close open resources etc).
 void execute()
          Execute the command.
 boolean getValue()
           
 void propertyValueChanged(PropertyEvent e)
           
 void setValue(boolean newValue)
           
 
Methods inherited from class dsto.dfc.swt.commands.AbstractCommand
addCommandListener, clone, createDefaultDisplayName, fireCommandExecuted, fireCommandExecuted, getAccelerator, getContextMenuGroup, getDescription, getDisplayName, getGroupInView, getIcon, getLogString, getMainMenuGroup, getMnemonic, getName, getToolbarGroup, isEnabled, isInteractive, removeCommandListener, setAccelerator, setContextMenuGroup, setDescription, setDisplayName, setEnabled, setIcon, setInteractive, setMainMenuGroup, setMnemonic, setName, setToolbarGroup
 
Methods inherited from class dsto.dfc.util.BasicPropertyEventSource
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener, setPropertyChangeSource
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface dsto.dfc.swt.commands.Command
addCommandListener, getAccelerator, getDescription, getDisplayName, getGroupInView, getIcon, getLogString, getMnemonic, getName, isEnabled, isInteractive, removeCommandListener, setAccelerator, setContextMenuGroup, setDescription, setDisplayName, setEnabled, setIcon, setMainMenuGroup, setMnemonic, setToolbarGroup
 
Methods inherited from interface dsto.dfc.util.PropertyEventSource
addPropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

CmdToggleDataBeanProperty

public CmdToggleDataBeanProperty(IDataBean bean,
                                 String property,
                                 String name,
                                 String iconName,
                                 String group,
                                 String description,
                                 char mnemonic,
                                 int accelerator)
Method Detail

dispose

public void dispose()
Description copied from interface: Disposable
Dispose of the object (unregister listeners, close open resources etc). It should be safe to call this method more than once. Note for beans that support client event listeners: if there are listeners registered when this is called, this method should do nothing.

Specified by:
dispose in interface Disposable

execute

public void execute()
Description copied from interface: Command
Execute the command. Commands should fire CommandListener.commandExecuted(CommandEvent) when executed.

Specified by:
execute in interface Command
Specified by:
execute in class AbstractCommand

getValue

public boolean getValue()

setValue

public void setValue(boolean newValue)

createMenuProvider

public CommandMenuItemProvider createMenuProvider(CommandView commandView,
                                                  org.eclipse.swt.widgets.Menu menu,
                                                  int index)
Description copied from interface: CustomMenuCommand
Create a menu UI provider for the command.

Specified by:
createMenuProvider in interface CustomMenuCommand
Parameters:
commandView - The command view.
menu - The host menu for the UI.
index - The index for the UI item(s).
Returns:
A CommandMenuItemProvider that provides the UI.

createToolbarProvider

public CommandToolbarItemProvider createToolbarProvider(CommandView commandView,
                                                        org.eclipse.swt.widgets.ToolBar toolbar,
                                                        int index)
Description copied from interface: CustomToolbarCommand
Create a toolbarUI provider for the command.

Specified by:
createToolbarProvider in interface CustomToolbarCommand
Parameters:
commandView - The command view.
toolbar - The host toolbar for the UI.
index - The index for the UI item(s).
Returns:
A CommandMenuItemProvider that provides the UI.

propertyValueChanged

public void propertyValueChanged(PropertyEvent e)
Specified by:
propertyValueChanged in interface PropertyListener


Copyright © 2008 Commonwealth of Australia