dsto.dfc.swt.commands
Class CmdSetBeanProperty

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
      extended by dsto.dfc.swt.commands.AbstractCommand
          extended by dsto.dfc.swt.commands.BasicToggleCommand
              extended by dsto.dfc.swt.commands.CmdSetBeanProperty
All Implemented Interfaces:
Command, CustomMenuCommand, CustomToolbarCommand, Copyable, Disposable, JavaBean, PropertyEventSource, Serializable, Cloneable, EventListener, org.eclipse.jface.util.IPropertyChangeListener

public class CmdSetBeanProperty
extends BasicToggleCommand
implements org.eclipse.jface.util.IPropertyChangeListener, Disposable

Command that sets the value of a Bean property (ie via a setX () method). The command is displayed as checked (or selected when shown as a button on a toolbar) when the current property value matches the command. The target Bean must support property change notification via the JFace IPropertyChangeListener or java.beans.PropertyChangeListener interface.

Author:
Matthew Phillips
See Also:
Serialized Form

Field Summary
 
Fields inherited from class dsto.dfc.swt.commands.BasicToggleCommand
value
 
Fields inherited from class dsto.dfc.swt.commands.AbstractCommand
NO_ICON
 
Constructor Summary
CmdSetBeanProperty(Object bean, String property, Object value, String name, Icon icon, String group, String description)
           
CmdSetBeanProperty(Object bean, String property, Object value, String name, String iconName, String group, String description)
           
 
Method Summary
 void dispose()
          Dispose of the object (unregister listeners, close open resources etc).
 void execute()
          Execute the command.
 void propertyChange(org.eclipse.jface.util.PropertyChangeEvent e)
           
 
Methods inherited from class dsto.dfc.swt.commands.BasicToggleCommand
createMenuProvider, createToolbarProvider, doSetValue, getValue, setValue
 
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

CmdSetBeanProperty

public CmdSetBeanProperty(Object bean,
                          String property,
                          Object value,
                          String name,
                          String iconName,
                          String group,
                          String description)

CmdSetBeanProperty

public CmdSetBeanProperty(Object bean,
                          String property,
                          Object value,
                          String name,
                          Icon icon,
                          String group,
                          String description)
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
Overrides:
execute in class BasicToggleCommand

propertyChange

public void propertyChange(org.eclipse.jface.util.PropertyChangeEvent e)
Specified by:
propertyChange in interface org.eclipse.jface.util.IPropertyChangeListener


Copyright © 2008 Commonwealth of Australia