|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.common.command.AbstractCommand
org.eclipse.emf.edit.command.AbstractOverrideableCommand
org.eclipse.emf.edit.command.PasteFromClipboardCommand
This works exactly like an AddCommand
but the things to be added are copied from the EditingDomain
clipboard.
Nested Class Summary |
Nested classes inherited from class org.eclipse.emf.common.command.AbstractCommand |
AbstractCommand.NonDirtying |
Field Summary | |
protected StrictCompoundCommand |
command
This is the command that does the actual pasting. |
protected static String |
DESCRIPTION
This caches the description. |
protected Object |
feature
This is feature of the owner where the clipboard copy is pasted. |
protected int |
index
This is index in the feature of the owner where the clipboard copy is pasted. |
protected static String |
LABEL
This caches the label. |
protected boolean |
optimize
This controls whether or not to optimize the canExecute (prepare) |
protected Object |
owner
This is object where the clipboard copy is pasted. |
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 | |
PasteFromClipboardCommand(EditingDomain domain,
Object owner,
Object feature,
int index)
This constructs an instance from the domain, which provides access the clipboard collection via EditingDomain.getCommandStack() . |
|
PasteFromClipboardCommand(EditingDomain domain,
Object owner,
Object feature,
int index,
boolean optimize)
|
Method Summary | |
static Command |
create(EditingDomain domain,
Object owner,
Object feature)
This creates a command to add copies from the clipboard to the specified feature of the owner. |
static Command |
create(EditingDomain domain,
Object owner,
Object feature,
int index)
This creates a command to add copies from the clipboard to the specified feature of the owner and at the given index. |
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. |
Object |
getFeature()
|
int |
getIndex()
|
Object |
getOwner()
|
protected boolean |
optimizedCanExecute()
|
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 |
protected static final String LABEL
protected static final String DESCRIPTION
protected StrictCompoundCommand command
protected Object owner
protected Object feature
protected int index
protected boolean optimize
Constructor Detail |
public PasteFromClipboardCommand(EditingDomain domain, Object owner, Object feature, int index)
EditingDomain.getCommandStack()
.
public PasteFromClipboardCommand(EditingDomain domain, Object owner, Object feature, int index, boolean optimize)
Method Detail |
public static Command create(EditingDomain domain, Object owner, Object feature)
public static Command create(EditingDomain domain, Object owner, Object feature, int index)
public Object getOwner()
public Object getFeature()
public int getIndex()
protected boolean prepare()
AbstractCommand
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.
prepare
in class AbstractCommand
protected boolean optimizedCanExecute()
public void doExecute()
OverrideableCommand
doExecute
in interface OverrideableCommand
doExecute
in class AbstractOverrideableCommand
public void doUndo()
OverrideableCommand
doUndo
in interface OverrideableCommand
doUndo
in class AbstractOverrideableCommand
public void doRedo()
OverrideableCommand
doRedo
in interface OverrideableCommand
doRedo
in class AbstractOverrideableCommand
public Collection doGetResult()
OverrideableCommand
doGetResult
in interface OverrideableCommand
doGetResult
in class AbstractOverrideableCommand
public Collection doGetAffectedObjects()
OverrideableCommand
doGetAffectedObjects
in interface OverrideableCommand
doGetAffectedObjects
in class AbstractOverrideableCommand
public void doDispose()
OverrideableCommand
doDispose
in interface OverrideableCommand
doDispose
in class AbstractOverrideableCommand
public String toString()
toString
in class AbstractOverrideableCommand
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |