|
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(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)
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(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. |
protected org.eclipse.emf.ecore.EAttribute |
getNameAttribute(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EClass eClass)
By default, there are no collisions in pasting. |
org.eclipse.emf.ecore.xmi.XMLResource |
getResource(org.eclipse.emf.ecore.EObject eObject)
By default, assumes that the eObject is attached to
an XML resource, and returns that. |
boolean |
hasPasteOption(org.eclipse.emf.ecore.EObject contextEObject,
org.eclipse.emf.ecore.EStructuralFeature eStructuralFeature,
PasteOption pasteOption)
By default, the following paste options are supported: PasteOption.NORMAL: always
others: never
|
boolean |
isCopyAlways(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.EReference eReference,
java.lang.Object value)
By default, transient and derived references are never copied, and containment references always are copied. |
boolean |
isNameable(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EObject eObject)
Default implementation does nothing, for those applications that do not support creation notifications. |
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)
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(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EClass eClass)
getPasteCollisionAction in interface IClipboardSupporteClass - the metaclass in question
PasteAction.ADD action, always
public boolean hasPasteOption(org.eclipse.emf.ecore.EObject contextEObject,
org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EObject context,
org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EObject parentElement,
org.eclipse.emf.ecore.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 org.eclipse.emf.ecore.xmi.XMLResource getResource(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.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 org.eclipse.emf.ecore.EAttribute getNameAttribute(org.eclipse.emf.ecore.EClass eClass)
null
if it has no attribute named "name".
eClass - an EClass
public boolean isNameable(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EObject eObject)
IClipboardSupporteObject has a name.
getName in interface IClipboardSupporteObject - an element
null if notIClipboardSupport.isNameable(EObject)
public void setName(org.eclipse.emf.ecore.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(org.eclipse.emf.ecore.EObject eObject)
eObject from its container.
destroy in interface IClipboardSupporteObject - the object to be destroyedpublic void sendCreateNotification(org.eclipse.emf.ecore.EObject eObject)
sendCreateNotification in interface IClipboardSupporteObject - an object newly created in the editing domain
public boolean canContain(org.eclipse.emf.ecore.EObject container,
org.eclipse.emf.ecore.EReference reference,
org.eclipse.emf.ecore.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.