dsto.dfc.swt.commands
Class CmdToggleWindowStyle

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.CmdToggleWindowStyle
All Implemented Interfaces:
Command, CustomMenuCommand, CustomToolbarCommand, Copyable, JavaBean, PropertyEventSource, Serializable, Cloneable

public class CmdToggleWindowStyle
extends BasicToggleCommand

Command to toggle a style setting on a JFace window. Since most styles cannot be changed on a shell once created, the style setting is changed by toggling the boolean value of given data bean property and re-creating the window using close/open. It is assumed that the window bases its style settings on the changed property.

Version:
$Revision$
Author:
mpp
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
CmdToggleWindowStyle(String name, org.eclipse.jface.window.Window window, IDataBean preferences, String styleProperty)
          Create the command.
 
Method Summary
 void execute()
          Execute the command.
 
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

CmdToggleWindowStyle

public CmdToggleWindowStyle(String name,
                            org.eclipse.jface.window.Window window,
                            IDataBean preferences,
                            String styleProperty)
Create the command.

Parameters:
name - The name of the command eg "Always On Top", "Resizable", etc.
window - The window.
preferences - The preferences to modify.
styleProperty - The property to toggle.
Method Detail

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


Copyright © 2008 Commonwealth of Australia