|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IClipboardSupport
An interface to be implemented by EMF metamodel providers to inject metamodel-specific semantics into copy/paste operations. Basically it has hints (e.g., what to do when pasted elements collide, what related elements should always be copied together, etc.) that helps the framework to make decisions. For maximal flexibility, it is even possible to override the paste operstion altogether.
This interface is intended to be implemented by plug-ins on the
clipboardSupport extension point.
See the AbstractClipboardSupport
for a convenient superclass for
your implementation.
AbstractClipboardSupport
Method Summary | |
---|---|
boolean |
canContain(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.EClass containedType)
Queries whether an object can contain an object of a given type in a specified containment reference. |
void |
destroy(org.eclipse.emf.ecore.EObject eObject)
Destroys an eObject , to ensure that it no longer exists in
its containing resource. |
java.util.Collection |
getExcludedCopyObjects(java.util.Set eObjects)
Queries whether any of a set of EObject s, or any objects
contained in their sub-trees,
should be excluded altogether from the copy operation. |
java.lang.String |
getName(org.eclipse.emf.ecore.EObject eObject)
Obtains the "name" of an element, if the metamodel supports the concept of naming elements and this eObject has a name. |
OverridePasteChildOperation |
getOverrideChildPasteOperation(PasteChildOperation overriddenChildPasteOperation)
Obtains an override for the specified paste operation. |
OverrideCopyOperation |
getOverrideCopyOperation(CopyOperation overriddenCopyOperation)
Obtains an override for the specified copy operation. |
PasteAction |
getPasteCollisionAction(org.eclipse.emf.ecore.EClass eClass)
Queries what to do when a paste collision occurs on instances of a particular metaclass. |
org.eclipse.emf.ecore.xmi.XMLResource |
getResource(org.eclipse.emf.ecore.EObject eObject)
Obtains the resource containing an eObject or, if the
eObject is to be copied but is not attached to a resource,
the resource containing some related element that the detached
eObject would otherwise have been in. |
boolean |
hasPasteOption(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
PasteOption pasteOption)
Queries whether a feature supports a particular paste option. |
boolean |
isCopyAlways(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference eReference,
java.lang.Object value)
Queries whether a reference needs to be copied even though the referenced element was not specifically included in the copy request. |
boolean |
isNameable(org.eclipse.emf.ecore.EObject eObject)
Queries whether an eObject 's metamodel supports the concept
of "naming" the eObject . |
void |
performPostPasteProcessing(java.util.Set pastedEObjects)
Performs what is necessary by the target paste model for the newly pasted elements This because we disable the semantic procedures, and they used to handle migration of profiles. now this function will end up doing that. |
void |
sendCreateNotification(org.eclipse.emf.ecore.EObject eObject)
Sends a notification that an eObject was created in its
host editing domain. |
void |
setName(org.eclipse.emf.ecore.EObject eObject,
java.lang.String name)
Sets the "name" of an element, if the metamodel supports the concept of naming elements and this eObject is nameable. |
boolean |
shouldOverrideChildPasteOperation(org.eclipse.emf.ecore.EObject parentElement,
org.eclipse.emf.ecore.EObject childEObject)
Queries whether it is necessary to completely override the default paste behaviour for pasting the specified (contained) child object into its parent. |
boolean |
shouldOverrideCopyOperation(java.util.Collection eObjects,
java.util.Map hintMap)
Queries whether it is necessary to completely override the default copy behaviour for copying the specified objects. |
boolean |
shouldSaveContainmentFeature(org.eclipse.emf.ecore.EObject eObject)
Queries whether an eObject should have a reference to the
corresponding original element save along with a record of the original
containment feature. |
Method Detail |
---|
PasteAction getPasteCollisionAction(org.eclipse.emf.ecore.EClass eClass)
eClass
- the metaclass in question
boolean hasPasteOption(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature, PasteOption pasteOption)
context
- and object being copied or pastedeStructuralFeature
- a feature of the contextEObject
pasteOption
- the paste option to query
boolean isCopyAlways(org.eclipse.emf.ecore.EObject context, org.eclipse.emf.ecore.EReference eReference, java.lang.Object value)
context
- an object being copied that owns the referenceeReference
- the reference being to queryvalue
- the object(s) referenced by the eReference
.
It is either an EObject
or a collection of
EObject
s, according to the multiplicity of the reference
value
must also be copiedboolean shouldOverrideChildPasteOperation(org.eclipse.emf.ecore.EObject parentElement, org.eclipse.emf.ecore.EObject childEObject)
parentElement
- the target element into which a child is to be pastedchildEObject
- the child element to be pasted
true
if we want to completely override the
paste operation for this child; false
, otherwiseboolean shouldOverrideCopyOperation(java.util.Collection eObjects, java.util.Map hintMap)
eObjects
- a collection of EObject
s to be pastedhintMap
- the copy hints provided by the client of the
current copy operation
true
if we want to completely override the
copy operation for these objects; false
, otherwiseOverridePasteChildOperation getOverrideChildPasteOperation(PasteChildOperation overriddenChildPasteOperation)
shouldOverrideChildPasteOperation(EObject, EObject)
, and then
only if the latter returned true
.
overriddenChildPasteOperation
- the paste operation to override
null
if it is not
appropriate to override (only in the case that
shouldOverrideChildPasteOperation()
was false
)shouldOverrideChildPasteOperation(EObject, EObject)
OverrideCopyOperation getOverrideCopyOperation(CopyOperation overriddenCopyOperation)
shouldOverrideCopyOperation(Collection, Map)
, and then
only if the latter returned true
.
overriddenCopyOperation
- the copy operation to override
null
if it is not
appropriate to override (only in the case that
shouldOverrideCopyOperation()
was false
)shouldOverrideChildPasteOperation(EObject, EObject)
java.util.Collection getExcludedCopyObjects(java.util.Set eObjects)
EObject
s, or any objects
contained in their sub-trees,
should be excluded altogether from the copy operation. These objects
will not be copied. It is up to the receiver to explicitly search the
eObjects
recursively for exclusions.
eObjects
- the objects considered for copying
org.eclipse.emf.ecore.xmi.XMLResource getResource(org.eclipse.emf.ecore.EObject eObject)
eObject
or, if the
eObject
is to be copied but is not attached to a resource,
the resource containing some related element that the detached
eObject
would otherwise have been in.
eObject
- the object for which we need the associated resource
eObject
is
detached, some resource from which it is reachable via some
other attached objectboolean shouldSaveContainmentFeature(org.eclipse.emf.ecore.EObject eObject)
eObject
should have a reference to the
corresponding original element save along with a record of the original
containment feature. All original top-level copy objects must have
this information saved. As for their children (recursively), it is
optional.
eObject
- the eObject to query whether the containment feature
should be saved
void performPostPasteProcessing(java.util.Set pastedEObjects)
pastedEObjects
- the pasted objects to processboolean isNameable(org.eclipse.emf.ecore.EObject eObject)
eObject
's metamodel supports the concept
of "naming" the eObject
. The "name" of an element may be
assigned to copies with an adornment (e.g., "Copy of " as done by a
certain well-known file system).
eObject
- an EObject
eObject
supports a "name" of some kindgetName(EObject)
,
setName(EObject, String)
java.lang.String getName(org.eclipse.emf.ecore.EObject eObject)
eObject
has a name.
eObject
- an element
null
if notisNameable(EObject)
void setName(org.eclipse.emf.ecore.EObject eObject, java.lang.String name)
eObject
is nameable.
eObject
- an elementname
- the element's new "name", or null
to clear it
java.lang.IllegalArgumentException
- if the eObject
is not
nameableisNameable(EObject)
void destroy(org.eclipse.emf.ecore.EObject eObject)
eObject
, to ensure that it no longer exists in
its containing resource. At a minimum, this method must remove the
eObject
from its container. It may also do more, such as
cleaning up references to the eObject
.
eObject
- the object to be destroyedvoid sendCreateNotification(org.eclipse.emf.ecore.EObject eObject)
eObject
was created in its
host editing domain. This is an optional operation, for those
applications that support the "create" notification type that is
currently deprecated in EMF.
eObject
- an object newly created in the editing domainboolean canContain(org.eclipse.emf.ecore.EObject container, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EClass containedType)
container
- a prospective containing objectreference
- the containment reference to checkcontainedType
- the type of the prospective contained object
true
if an element of the specified type is
permitted to be contained as indicated; false
, otherwise
|
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.