org.eclipse.emf.edit.command
Class CopyToClipboardCommand

java.lang.Object
  extended byorg.eclipse.emf.common.command.AbstractCommand
      extended byorg.eclipse.emf.edit.command.AbstractOverrideableCommand
          extended byorg.eclipse.emf.edit.command.CopyToClipboardCommand
All Implemented Interfaces:
AbstractCommand.NonDirtying, Command, OverrideableCommand
Direct Known Subclasses:
CopyToClipboardOverrideCommand

public class CopyToClipboardCommand
extends AbstractOverrideableCommand
implements AbstractCommand.NonDirtying

This works exactly like a CopyCommand but set the copy result to the EditingDomain. In fact, the implementation is just a proxy for copy command.


Nested Class Summary
 
Nested classes inherited from class org.eclipse.emf.common.command.AbstractCommand
AbstractCommand.NonDirtying
 
Field Summary
protected  Command copyCommand
          This is the command that does the actual copying.
protected static String DESCRIPTION
          This caches the description.
protected static String LABEL
          This caches the label.
protected  Collection oldClipboard
          This is the original clipboard value before execute.
protected  Collection sourceObjects
          This is the collection of objects to be copied to the clipboard.
 
Fields inherited from class org.eclipse.emf.edit.command.AbstractOverrideableCommand
domain, overrideCommand
 
Fields inherited from class org.eclipse.emf.common.command.AbstractCommand
description, isExecutable, isPrepared, label
 
Constructor Summary
CopyToClipboardCommand(EditingDomain domain, Collection collection)
          This constructs a command that copies the given collection of objects to the clipboard.
 
Method Summary
static Command create(EditingDomain domain, Collection collection)
          This creates a command that copies the given collection of objects to the clipboard.
static Command create(EditingDomain domain, Object owner)
          This creates a command that copies the given object to the clipboard.
 void doDispose()
          This is overrideable command's implementation of dispose.
 void doExecute()
          This is overrideable command's implementation of execute.
 Collection doGetAffectedObjects()
          This is overrideable command's implementation of getAffectedObjects.
 Collection doGetResult()
          This is overrideable command's implementation of getResult.
 void doRedo()
          This is overrideable command's implementation of redo.
 void doUndo()
          This is overrideable command's implementation of undo.
 Collection getSourceObjects()
          This returns the collection of objects to be copied to the clipboard.
protected  boolean prepare()
          Called at most once in AbstractOverrideableCommand.canExecute() to give the command an opportunity to ready itself for execution.
 String toString()
          This gives an abbreviated name using this object's own class' name, without package qualification, followed by a space separated list of field:value pairs.
 
Methods inherited from class org.eclipse.emf.edit.command.AbstractOverrideableCommand
canExecute, canUndo, dispose, doCanExecute, doCanUndo, doGetChildrenToCopy, doGetDescription, doGetLabel, execute, getAffectedObjects, getChildrenToCopy, getDescription, getDomain, getLabel, getOverride, getOwnerList, getResult, redo, setOverride, undo
 
Methods inherited from class org.eclipse.emf.common.command.AbstractCommand
chain, setDescription, setLabel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.emf.common.command.Command
chain
 

Field Detail

LABEL

protected static final String LABEL
This caches the label.


DESCRIPTION

protected static final String DESCRIPTION
This caches the description.


sourceObjects

protected Collection sourceObjects
This is the collection of objects to be copied to the clipboard.


oldClipboard

protected Collection oldClipboard
This is the original clipboard value before execute.


copyCommand

protected Command copyCommand
This is the command that does the actual copying.

Constructor Detail

CopyToClipboardCommand

public CopyToClipboardCommand(EditingDomain domain,
                              Collection collection)
This constructs a command that copies the given collection of objects to the clipboard.

Method Detail

create

public static Command create(EditingDomain domain,
                             Collection collection)
This creates a command that copies the given collection of objects to the clipboard.


create

public static Command create(EditingDomain domain,
                             Object owner)
This creates a command that copies the given object to the clipboard.


getSourceObjects

public Collection getSourceObjects()
This returns the collection of objects to be copied to the clipboard.


prepare

protected boolean prepare()
Description copied from class: AbstractCommand
Called at most once in AbstractCommand.canExecute() to give the command an opportunity to ready itself for execution. The returned value is stored in AbstractCommand.canExecute(). In other words, you can override this method to initialize and to yield a cached value for the all subsequent calls to canExecute.

Overrides:
prepare in class AbstractCommand
Returns:
whether the command is executable.

doExecute

public void doExecute()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of execute.

Specified by:
doExecute in interface OverrideableCommand
Specified by:
doExecute in class AbstractOverrideableCommand

doUndo

public void doUndo()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of undo.

Specified by:
doUndo in interface OverrideableCommand
Specified by:
doUndo in class AbstractOverrideableCommand

doRedo

public void doRedo()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of redo.

Specified by:
doRedo in interface OverrideableCommand
Specified by:
doRedo in class AbstractOverrideableCommand

doGetResult

public Collection doGetResult()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of getResult.

Specified by:
doGetResult in interface OverrideableCommand
Overrides:
doGetResult in class AbstractOverrideableCommand

doGetAffectedObjects

public Collection doGetAffectedObjects()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of getAffectedObjects.

Specified by:
doGetAffectedObjects in interface OverrideableCommand
Overrides:
doGetAffectedObjects in class AbstractOverrideableCommand

doDispose

public void doDispose()
Description copied from interface: OverrideableCommand
This is overrideable command's implementation of dispose.

Specified by:
doDispose in interface OverrideableCommand
Overrides:
doDispose in class AbstractOverrideableCommand

toString

public String toString()
This gives an abbreviated name using this object's own class' name, without package qualification, followed by a space separated list of field:value pairs.

Overrides:
toString in class AbstractOverrideableCommand

Copyright 2001-2006 IBM Corporation and others.
All Rights Reserved.