org.eclipse.gmf.runtime.emf.clipboard.core
Class BasePasteOperation
java.lang.Object
org.eclipse.gmf.runtime.emf.clipboard.core.ClipboardOperation
org.eclipse.gmf.runtime.emf.clipboard.core.BasePasteOperation
-
Direct Known Subclasses:
-
PasteChildOperation
-
public abstract class BasePasteOperation
- extends
ClipboardOperation
Abstract specification of all paste operations, providing common behaviours
and enforcing certain protocols.
Note that this class is not intended to be extended "directly"
by clients. Clients may not instantiate it. Clients that need to extend
or override the default paste operation should extend the
OverridePasteChildOperation
class, instead. Clients may also extend
the
PostPasteChildOperation
.
-
See Also:
-
OverridePasteChildOperation
,
PostPasteChildOperation
Field Summary
|
static java.lang.String
|
PASTE
A constant whose value is "paste". |
Method Summary
|
protected void
|
addCriticalResolveFailure
(org.eclipse.emf.ecore.EObject nonResolvedObject)
Adds a critical resolution failure to my set and the overall failures set
for the bigger paste operation. |
protected void
|
addMergedElementEntry
(org.eclipse.emf.ecore.EObject mergedObject,
org.eclipse.gmf.runtime.emf.clipboard.core.internal.MergedEObjectInfo mergedEObjectInfo)
Adds a merged element to my map and the overall merges map
for the bigger paste operation. |
protected void
|
addPastedElement
(org.eclipse.emf.ecore.EObject pastedElement)
Adds a successfully pasted element to my set and the overall pasted
elements set for the bigger paste operation. |
protected void
|
addPasteFailuresObject
(org.eclipse.emf.ecore.EObject eObject)
Adds an element that did not successfully paste to my set and the
overall paste failures set for the bigger paste operation. |
java.util.Set
|
getAllCriticalResolveFailuresSet
()
Obtains the overall set of all critical resolution failures for the
bigger paste operation, of which my own are a subset. |
java.util.Map
|
getAllMergedElementsMap
()
Obtains the overall map of all merged elements for the
bigger paste operation, of which my own are a subset. |
java.util.Set
|
getAllPastedElementSet
()
Obtains the overall set of all elements pasted by the
bigger paste operation, of which my own are a subset. |
java.util.Set
|
getAllPasteFailuresObjectSet
()
Obtains my
failed pastes,
or my parent operation's if I have one. |
java.util.Set
|
getCriticalResolveFailuresSet
()
Obtains my own subset of critical resolution failures. |
protected java.util.Map
|
getLoadOptionsMap
()
Obtains the EMF resource load options that are used to deserialize the
resource that was copied to the clipboard. |
java.util.Map
|
getMergedElementsMap
()
Obtains my own subset map of merged elements. |
java.util.Set
|
getPastedElementSet
()
Obtains my own subset of pasted elements. |
java.util.Set
|
getPasteFailuresObjectSet
()
Obtains my own subset of objects that failed to paste. |
protected org.eclipse.gmf.runtime.emf.clipboard.core.internal.ResourceInfo
|
getResourceInfo
()
Obtains my resource meta-data structure. |
BasePasteOperation
|
getSpawningPasteOperation
()
Obtains the superordinate paste operation that created me, if any. |
abstract void
|
paste
()
Performs the paste operation. |
protected void
|
removeCriticalResolveFailure
(org.eclipse.emf.ecore.EObject newlyResolvedObject)
Removes a critical resolution failure from my set and the overall
failures set for the bigger paste operation, for an object which has
turned out resolvable after all. |
protected void
|
throwCancelException
()
Throws an operation cancel exception to end a paste process. |
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
|
PASTE
public static final java.lang.String PASTE
- A constant whose value is "paste".
-
See Also:
-
Constant Field Values
BasePasteOperation
public BasePasteOperation(
IProgressMonitor monitor,
java.util.Map loadOptionsMap,
org.eclipse.gmf.runtime.emf.clipboard.core.internal.ResourceInfo resourceInfo,
IClipboardSupport clipboardSupport)
- Initializes me.
-
Parameters:
-
monitor
- an optional monitor to track paste progress -
loadOptionsMap
- map of EMF resource load options for
deserialization of the resource that was copied to the clipboard -
resourceInfo
- the resource information data structure to fill in
when deserializing the copied resource -
clipboardSupport
- the clipboard support object governing this
copy/paste operation
BasePasteOperation
public BasePasteOperation(
BasePasteOperation spawningPasteOperation)
- Initializes me with a superordinate paste operation that has created me.
I copy much of my environment from it.
-
Parameters:
-
spawningPasteOperation
- the paste operation that created me
getResourceInfo
protected final org.eclipse.gmf.runtime.emf.clipboard.core.internal.ResourceInfo getResourceInfo()
- Obtains my resource meta-data structure.
-
-
Returns:
- my resource meta-data
getLoadOptionsMap
protected final java.util.Map getLoadOptionsMap()
- Obtains the EMF resource load options that are used to deserialize the
resource that was copied to the clipboard.
-
-
Returns:
- my load options
paste
public abstract void paste()
throws java.lang.Exception
- Performs the paste operation.
-
-
Throws:
-
java.lang.Exception
- if anything goes wrong in pasting
getSpawningPasteOperation
public
BasePasteOperation getSpawningPasteOperation()
- Obtains the superordinate paste operation that created me, if any.
-
-
Returns:
- my parent paste operation, or
null
if I am the
root operation
getAllCriticalResolveFailuresSet
public final java.util.Set getAllCriticalResolveFailuresSet()
- Obtains the overall set of all critical resolution failures for the
bigger paste operation, of which my own are a subset.
-
-
Returns:
- the set of all critical resolution failures
-
See Also:
-
getCriticalResolveFailuresSet()
getAllMergedElementsMap
public final java.util.Map getAllMergedElementsMap()
- Obtains the overall map of all merged elements for the
bigger paste operation, of which my own are a subset.
-
-
Returns:
- the map of all merged elements
-
See Also:
-
getMergedElementsMap()
getAllPastedElementSet
public final java.util.Set getAllPastedElementSet()
- Obtains the overall set of all elements pasted by the
bigger paste operation, of which my own are a subset.
-
-
Returns:
- the set of all pasted elements
-
See Also:
-
getPastedElementSet()
getCriticalResolveFailuresSet
public final java.util.Set getCriticalResolveFailuresSet()
- Obtains my own subset of critical resolution failures.
-
-
Returns:
- my critical resolution failures
-
See Also:
-
getAllCriticalResolveFailuresSet()
addCriticalResolveFailure
protected void addCriticalResolveFailure(org.eclipse.emf.ecore.EObject nonResolvedObject)
- Adds a critical resolution failure to my set and the overall failures set
for the bigger paste operation.
-
-
Parameters:
-
nonResolvedObject
- an unresolvable object
removeCriticalResolveFailure
protected void removeCriticalResolveFailure(org.eclipse.emf.ecore.EObject newlyResolvedObject)
- Removes a critical resolution failure from my set and the overall
failures set for the bigger paste operation, for an object which has
turned out resolvable after all.
-
-
Parameters:
-
newlyResolvedObject
- an object that did resolve
getMergedElementsMap
public final java.util.Map getMergedElementsMap()
- Obtains my own subset map of merged elements.
-
-
Returns:
- my merged elements
-
See Also:
-
getMergedElementsMap()
addMergedElementEntry
protected void addMergedElementEntry(org.eclipse.emf.ecore.EObject mergedObject,
org.eclipse.gmf.runtime.emf.clipboard.core.internal.MergedEObjectInfo mergedEObjectInfo)
- Adds a merged element to my map and the overall merges map
for the bigger paste operation.
-
-
Parameters:
-
mergedObject
- a merged object (key) -
mergedEObjectInfo
- the information about the merge (value)
getPastedElementSet
public final java.util.Set getPastedElementSet()
- Obtains my own subset of pasted elements.
-
-
Returns:
- my pasted elements
-
See Also:
-
getAllPastedElementSet()
addPastedElement
protected void addPastedElement(org.eclipse.emf.ecore.EObject pastedElement)
- Adds a successfully pasted element to my set and the overall pasted
elements set for the bigger paste operation.
-
-
Parameters:
-
pastedElement
- an element that was successfully pasted
getPasteFailuresObjectSet
public final java.util.Set getPasteFailuresObjectSet()
- Obtains my own subset of objects that failed to paste.
-
-
Returns:
- my failed pastes
-
See Also:
-
getAllPasteFailuresObjectSet()
addPasteFailuresObject
protected void addPasteFailuresObject(org.eclipse.emf.ecore.EObject eObject)
- Adds an element that did not successfully paste to my set and the
overall paste failures set for the bigger paste operation.
-
-
Parameters:
-
eObject
- an element that was not successfully pasted
getAllPasteFailuresObjectSet
public final java.util.Set getAllPasteFailuresObjectSet()
- Obtains my
failed pastes,
or my parent operation's if I have one.
-
-
Returns:
- my parent's paste failures, or my own if I am the
root paste operation
-
See Also:
-
getPasteFailuresObjectSet()
throwCancelException
protected void throwCancelException()
- Throws an operation cancel exception to end a paste process.
-
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.