|
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.AbstractClipboardSupport
public class AbstractClipboardSupport
A convenient default implementation of most of the features required of a clipboard support utility.
This class is intended to be extended by clients.
| Constructor Summary | |
|---|---|
AbstractClipboardSupport()
Initializes me. |
|
| Method Summary | |
|---|---|
boolean |
canContain(EObject container,
EReference reference,
EClass containedType)
Queries whether an object can contain an object of a given type in a specified containment reference. |
void |
destroy(EObject eObject)
Simply removes an eObject from its container. |
java.util.Collection |
getExcludedCopyObjects(java.util.Set eObjects)
By default, don't exclude any objects from the copy operation. |
java.lang.String |
getName(EObject eObject)
Obtains the "name" of an element, if the metamodel supports the concept of naming elements and this eObject has a name. |
protected EAttribute |
getNameAttribute(EClass eClass)
Obtains the cached name attribute of an eClass, or null
if it has no attribute named "name". |
OverridePasteChildOperation |
getOverrideChildPasteOperation(PasteChildOperation overriddenChildPasteOperation)
By default, don't provide any child paste override behaviour. |
OverrideCopyOperation |
getOverrideCopyOperation(CopyOperation overriddenCopyOperation)
By default, don't provide any copy override behaviour. |
PasteAction |
getPasteCollisionAction(EClass eClass)
By default, there are no collisions in pasting. |
XMLResource |
getResource(EObject eObject)
By default, assumes that the eObject is attached to
an XML resource, and returns that. |
boolean |
hasPasteOption(EObject contextEObject,
EStructuralFeature eStructuralFeature,
PasteOption pasteOption)
By default, the following paste options are supported: PasteOption.NORMAL: always
others: never
|
boolean |
isCopyAlways(EObject context,
EReference eReference,
java.lang.Object value)
By default, transient and derived references are never copied, and containment references always are copied. |
boolean |
isNameable(EObject eObject)
By default, elements are nameable if they have an EAttribute
named "name". |
void |
performPostPasteProcessing(java.util.Set pastedEObjects)
By default, there is no post processing to be done. |
void |
sendCreateNotification(EObject eObject)
Default implementation does nothing, for those applications that do not support creation notifications. |
void |
setName(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(EObject parentElement,
EObject childEObject)
By default, don't provide any child paste override behaviour. |
boolean |
shouldOverrideCopyOperation(java.util.Collection eObjects,
java.util.Map hintMap)
By default, don't provide any copy override behaviour. |
boolean |
shouldSaveContainmentFeature(EObject eObject)
By default, we always remember the containment feature of an object, unless it is an Ecore element (such as an annotation) or it is a detached element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractClipboardSupport()
| Method Detail |
|---|
public PasteAction getPasteCollisionAction(EClass eClass)
getPasteCollisionAction in interface IClipboardSupporteClass - the metaclass in question
PasteAction.ADD action, always
public boolean hasPasteOption(EObject contextEObject,
EStructuralFeature eStructuralFeature,
PasteOption pasteOption)
PasteOption.NORMAL: always
hasPasteOption in interface IClipboardSupportcontextEObject - and object being copied or pastedeStructuralFeature - a feature of the contextEObjectpasteOption - the paste option to query
public boolean isCopyAlways(EObject context,
EReference eReference,
java.lang.Object value)
isCopyAlways in interface IClipboardSupportcontext - 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
EObjects, according to the multiplicity of the reference
value must also be copied
public boolean shouldOverrideChildPasteOperation(EObject parentElement,
EObject childEObject)
shouldOverrideChildPasteOperation in interface IClipboardSupportparentElement - the target element into which a child is to be pastedchildEObject - the child element to be pasted
false, always
public boolean shouldOverrideCopyOperation(java.util.Collection eObjects,
java.util.Map hintMap)
shouldOverrideCopyOperation in interface IClipboardSupporteObjects - a collection of EObjects to be pastedhintMap - the copy hints provided by the client of the
current copy operation
false, alwayspublic OverridePasteChildOperation getOverrideChildPasteOperation(PasteChildOperation overriddenChildPasteOperation)
getOverrideChildPasteOperation in interface IClipboardSupportoverriddenChildPasteOperation - the paste operation to override
null, alwaysIClipboardSupport.shouldOverrideChildPasteOperation(EObject, EObject)public OverrideCopyOperation getOverrideCopyOperation(CopyOperation overriddenCopyOperation)
getOverrideCopyOperation in interface IClipboardSupportoverriddenCopyOperation - the copy operation to override
null, alwaysIClipboardSupport.shouldOverrideChildPasteOperation(EObject, EObject)public java.util.Collection getExcludedCopyObjects(java.util.Set eObjects)
getExcludedCopyObjects in interface IClipboardSupporteObjects - the objects considered for copying
public XMLResource getResource(EObject eObject)
eObject is attached to
an XML resource, and returns that.
getResource in interface IClipboardSupporteObject - the object for which we need the associated resource
eObject is
detached, some resource from which it is reachable via some
other attached objectpublic boolean shouldSaveContainmentFeature(EObject eObject)
shouldSaveContainmentFeature in interface IClipboardSupporteObject - the eObject to query whether the containment feature
should be saved
false if the eObject is an Ecore
object or is detached; true, otherwisepublic void performPostPasteProcessing(java.util.Set pastedEObjects)
performPostPasteProcessing in interface IClipboardSupportpastedEObjects - the pasted objects to processprotected EAttribute getNameAttribute(EClass eClass)
null
if it has no attribute named "name".
eClass - an EClass
public boolean isNameable(EObject eObject)
EAttribute
named "name".
isNameable in interface IClipboardSupporteObject - an EObject
eObject supports a "name" of some kindIClipboardSupport.getName(EObject),
IClipboardSupport.setName(EObject, String)public java.lang.String getName(EObject eObject)
IClipboardSupporteObject has a name.
getName in interface IClipboardSupporteObject - an element
null if notIClipboardSupport.isNameable(EObject)
public void setName(EObject eObject,
java.lang.String name)
IClipboardSupporteObject is nameable.
setName in interface IClipboardSupporteObject - an elementname - the element's new "name", or null to clear itIClipboardSupport.isNameable(EObject)public void destroy(EObject eObject)
eObject from its container.
destroy in interface IClipboardSupporteObject - the object to be destroyedpublic void sendCreateNotification(EObject eObject)
sendCreateNotification in interface IClipboardSupporteObject - an object newly created in the editing domain
public boolean canContain(EObject container,
EReference reference,
EClass containedType)
IClipboardSupport
canContain in interface IClipboardSupportcontainer - a prospective containing objectreference - the containment reference to checkcontainedType - the type of the prospective contained object
true if the reference's type is
compatible with the containedType; 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.