dsto.dfc.swt.dnd
Class CmdCopyObject

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
      extended by dsto.dfc.swt.commands.AbstractCommand
          extended by dsto.dfc.swt.commands.AbstractCopyCommand
              extended by dsto.dfc.swt.dnd.CmdCopyObject
All Implemented Interfaces:
Command, Copyable, JavaBean, PropertyEventSource, Serializable, Cloneable
Direct Known Subclasses:
CmdCopyDataObjectProperties

public class CmdCopyObject
extends AbstractCopyCommand

Command to copy an object to the clipboard.

Author:
Matthew Phillips
See Also:
CmdPasteObject, Serialized Form

Field Summary
protected  Object object
           
protected  org.eclipse.swt.dnd.Transfer[] transferFormats
           
 
Fields inherited from class dsto.dfc.swt.commands.AbstractCommand
NO_ICON
 
Constructor Summary
CmdCopyObject(org.eclipse.swt.dnd.Transfer transfer)
          Create a new instance.
 
Method Summary
protected  Object[] createTransferData()
          Create the data to be transferred when the command is executed.
 void execute()
          Execute the command.
 Object getObject()
           
 void setObject(Object newValue)
          Set the object to be copied.
 void setTransferFormat(org.eclipse.swt.dnd.Transfer transfer)
           
 void setTransferFormats(org.eclipse.swt.dnd.Transfer[] transfer)
           
 
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.util.PropertyEventSource
addPropertyChangeListener, removePropertyChangeListener
 

Field Detail

transferFormats

protected org.eclipse.swt.dnd.Transfer[] transferFormats

object

protected Object object
Constructor Detail

CmdCopyObject

public CmdCopyObject(org.eclipse.swt.dnd.Transfer transfer)
Create a new instance.

Parameters:
transfer - The SWT Transfer type. eg an instance of DataObjectTransfer.
Method Detail

getObject

public Object getObject()

setObject

public void setObject(Object newValue)
Set the object to be copied.


setTransferFormat

public void setTransferFormat(org.eclipse.swt.dnd.Transfer transfer)

setTransferFormats

public void setTransferFormats(org.eclipse.swt.dnd.Transfer[] transfer)

createTransferData

protected Object[] createTransferData()
Create the data to be transferred when the command is executed. The default is to simply wrap object in an array. Subclasses may override to generate data at execution time.


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


Copyright © 2008 Commonwealth of Australia