|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.emf.clipboard.core.ClipboardUtil
public class ClipboardUtil
Utility for the creation of
IClipboardSupport
instances for
specific EMF metamodels, and for copy/paste operations to and from a String
form for use on the system clipboard.
Field Summary | |
---|---|
static java.lang.String |
HARVESTED_ELEMENT
Hint indicating that the elements to be pasted were harvested, rather than just copied. |
static java.lang.String |
IGNORE_RECYCLE_HINT_ID
Hint to ignore the recycle hint when pasting objects that were copied with the recycle hint. |
static java.lang.String |
MERGE_HINT_STRONG
Hint to perform "strong" merges when resolving paste collisions by merging. |
static java.lang.String |
MERGE_HINT_WEAK
Hint to perform "weak" merges when resolving paste collisions by merging. |
static java.lang.String |
PASTE_TO_TARGET_PARENT
Hint to attempt to paste into the parent of target element if target element doesn't accept the copied element. |
static java.lang.String |
RECYCLE_HINT_ID
Hint to retain the original element's ID when pasting it. |
Method Summary | |
---|---|
static java.lang.String |
copyElementsToString(java.util.Collection eObjects,
java.util.Map hints,
IProgressMonitor monitor)
Serializes elements to a string suitable for putting on the system clipboard. |
static IClipboardSupport |
createClipboardSupport(org.eclipse.emf.ecore.EClass eClass)
Obtains the clipboard copy/paste support utility, if any, for the specified eClass 's metamodel. |
static java.util.Collection |
pasteElementsFromString(java.lang.String string,
org.eclipse.emf.ecore.EObject targetElement,
java.util.Map hints,
IProgressMonitor monitor)
Deerializes elements from a string (obtained from the system clipboard) and pastes them into the specified target element. |
static java.util.Collection |
pasteElementsFromString(java.lang.String string,
org.eclipse.emf.ecore.resource.Resource targetElement,
java.util.Map hints,
IProgressMonitor monitor)
Deerializes elements from a string (obtained from the system clipboard) and pastes them into the specified target element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MERGE_HINT_WEAK
This hint is specified on a per-object basis.
MERGE_HINT_STRONG
,
Constant Field Valuespublic static final java.lang.String MERGE_HINT_STRONG
This hint is specified on a per-object basis.
MERGE_HINT_WEAK
,
Constant Field Valuespublic static final java.lang.String RECYCLE_HINT_ID
This hint is specified on a per-object basis.
public static final java.lang.String IGNORE_RECYCLE_HINT_ID
This hint applies to all objects: use it as a key in the hint map with a boolean value to indicate whether it is enabled.
public static final java.lang.String PASTE_TO_TARGET_PARENT
This hint is specified on a per-object basis.
public static final java.lang.String HARVESTED_ELEMENT
This hint is specified on a per-object basis.
Method Detail |
---|
public static java.lang.String copyElementsToString(java.util.Collection eObjects, java.util.Map hints, IProgressMonitor monitor)
eObjects
- a collection of EObject
s to be serializedhints
- a mapping of hints (defined as constants on this class), or
null
to provide no hintsmonitor
- a progress monitor to track progress, or
null
if no progress feedback is required
eObjects
public static java.util.Collection pasteElementsFromString(java.lang.String string, org.eclipse.emf.ecore.EObject targetElement, java.util.Map hints, IProgressMonitor monitor)
string
- the string containing the elements to be pastedtargetElement
- the element into which the new elements are to be
pastedhints
- a mapping of hints (defined as constants on this class), or
null
to provide no hintsmonitor
- a progress monitor to track progress, or
null
if no progress feedback is required
EObject
spublic static java.util.Collection pasteElementsFromString(java.lang.String string, org.eclipse.emf.ecore.resource.Resource targetElement, java.util.Map hints, IProgressMonitor monitor)
string
- the string containing the elements to be pastedtargetElement
- the element into which the new elements are to be
pastedhints
- a mapping of hints (defined as constants on this class), or
null
to provide no hintsmonitor
- a progress monitor to track progress, or
null
if no progress feedback is required
EObject
spublic static IClipboardSupport createClipboardSupport(org.eclipse.emf.ecore.EClass eClass)
eClass
's metamodel. If the metamodel does not
have a dedicated clipboard support implementation, then a default
implementation is provided that implements semantics similar to the
EcoreUtil.Copier
class.
eClass
- a metaclass
eClass
's metamodel's clipboard support
utility, or a null implementation if none is registered for it
(not actually null
)
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.