|
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.ClipboardSupportUtil
public final class ClipboardSupportUtil
Utilities to assist the implementation of IClipboardSupports by
plug-ins extending the clipboardSupport extension point.
| Field Summary | |
|---|---|
static int |
NONE
Index in an array or list indicating absence of the element sought. |
| Method Summary | |
|---|---|
static EObject |
appendEObject(Resource resource,
EObject referencedObject)
Appends a resource's contents with an additional reference. |
static EObject |
appendEObjectAt(EObject eObject,
EReference reference,
EObject referencedObject)
Appends an object's many reference with an additional reference. |
static java.util.List |
appendEObjectListAt(EObject eObject,
EReference reference,
java.util.List referencedObjects)
Appends an object's many reference with a list of additional references. |
static boolean |
containsAny(java.util.Collection collection1,
java.util.Collection collection2)
Queries whether two collections intersect. |
static void |
destroyEObject(EObject eObject,
EReference reference)
Clears an object's scalar reference. |
static void |
destroyEObjectInCollection(EObject eObject,
EReference reference,
EObject referencedObject)
Removes an element from an object's many reference. |
static void |
destroyEObjectInResource(EObject referencedObject)
Removes an element from a resource. |
static java.util.Collection |
getCopyElements(java.util.Collection elements)
Removes from a collection of elements any elements that
should not be copied. |
static EReference |
getPasteContainmentFeature(EObject parentEObject,
EObject eObject,
EReference originalReference)
Obtains the containment feature of a parent element into which a child should be pasted, that best matches the child's original containment feature. |
static boolean |
hasNameCollision(java.util.Collection list,
EObject eObject)
Queries whether an object is nameable and have the same name (ignoring case) as any element in a list. |
static boolean |
hasNameCollision(EObject eObject1,
EObject eObject2)
Queries whether two elements are both nameable and have the same name (ignoring case). |
static boolean |
isChild(EObject eParent,
EObject eObject)
Queries whether the specified eObject is contained within
another. |
static boolean |
isOkToAppendEObjectAt(EObject eObject,
EReference reference,
EObject referencedObject)
Queries whether a many reference may be appended with an new EObject. |
static boolean |
isOkToDestroyEObject(EObject eObject,
EReference reference)
Queries whether a scalar reference may be cleared. |
static boolean |
isOkToDestroyEObjectInCollection(EObject eObject,
EReference reference)
Queries whether a many reference may have a reference removed from it. |
static boolean |
isOkToSetEAttribute(EObject eObject,
EAttribute attribute,
java.lang.Object value)
Queries whether an attribute may be set to the specified new value. |
static boolean |
isOkToSetEList(EObject eObject,
EReference reference)
Queries whether a many reference may be replaced with an entirely new list of EObjects. |
static boolean |
isOkToSetEObject(EObject eObject,
EReference reference,
EObject referencedObject)
Queries whether a scalar reference may be set to an new EObject. |
static void |
rename(java.util.Collection list,
EObject eObject,
java.lang.String prefix)
Given an object that has a name collision with one or more elements in a list, renames it to have a unique name. |
static EObject |
resolve(EObject proxy,
java.util.Map idToEObjectMap)
Resolves a proxy, using the specified ID map. |
static EObject |
resolve(EObject proxy,
XMLResource resource)
Resolves a proxy, using the specified resource. |
static void |
sendCreateEvent(EObject eObject)
Broadcasts a creatio notification for a new EObject
via the appropriate clipboard support utility, if the metamodel support
such notifications. |
static void |
sendCreateEvent(java.util.List eObjects)
Broadcasts creation notifications for a list of new EObjects
via the appropriate clipboard support utility, if the metamodel support
such notifications. |
static void |
setEAttribute(EObject eObject,
EAttribute attribute,
java.lang.Object value)
Replaces an object's attribute with an new value. |
static EObject |
setEObject(EObject eObject,
EReference reference,
EObject referencedObject)
Replaces an object's scalar reference with an new element. |
static java.util.List |
setEObjectList(EObject eObject,
EReference reference,
java.util.List referencedObjects)
Replaces an object's many reference with an entirely new list of references. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
| Method Detail |
|---|
public static java.util.Collection getCopyElements(java.util.Collection elements)
elements any elements that
should not be copied. These are those that have containers that are
already in the elements collection.
elements - the collection of elements to be whittled down to those
that should be copied. Note that this collection is modified
in place
elements collection, again
public static java.util.List setEObjectList(EObject eObject,
EReference reference,
java.util.List referencedObjects)
reference specified is
not settable.
eObject - the element owning the reference to be setreference - the many reference to be setreferencedObjects - the new value of the reference; must be an
EList of EObjects
referencedObjectsisOkToSetEList(EObject, EReference)
public static boolean isOkToSetEList(EObject eObject,
EReference reference)
EObjects.
eObject - the owner of the referencereference - a many reference to query whether it is settable
true if the reference is changeable
and is not derived; false, otherwise
public static java.util.List appendEObjectListAt(EObject eObject,
EReference reference,
java.util.List referencedObjects)
eObject - the element owning the reference list to be appendedreference - the many reference to be appendedreferencedObjects - EObjects to append to the list
referencedObjects that were
successfully appendedappendEObjectAt(EObject, EReference, EObject)
public static EObject appendEObjectAt(EObject eObject,
EReference reference,
EObject referencedObject)
reference cannot be
appended.
eObject - the element owning the reference list to be appendedreference - the many reference to be appendedreferencedObject - an object to append to the list
referencedObject if it was successfully appended
to the reference; null, otherwiseappendEObjectAt(EObject, EReference, EObject),
isOkToAppendEObjectAt(EObject, EReference, EObject)
public static EObject appendEObject(Resource resource,
EObject referencedObject)
resource - the resourcereferencedObject - an object to append to the list
referencedObject if it was successfully appended
to the resource; null, otherwise
public static EObject setEObject(EObject eObject,
EReference reference,
EObject referencedObject)
reference specified is not
settable.
eObject - the element owning the reference to be setreference - the scalar reference to be setreferencedObject - the new value of the reference
referencedObjectsisOkToSetEObject(EObject, EReference, EObject)
public static void setEAttribute(EObject eObject,
EAttribute attribute,
java.lang.Object value)
attribute specified is not
settable.
eObject - the element owning the attribute to be setattribute - the attribute to be setvalue - the new value of the attributeisOkToSetEAttribute(EObject, EAttribute, Object)public static void sendCreateEvent(EObject eObject)
EObject
via the appropriate clipboard support utility, if the metamodel support
such notifications.
eObject - a newly created EObjectIClipboardSupport.sendCreateNotification(EObject)public static void sendCreateEvent(java.util.List eObjects)
EObjects
via the appropriate clipboard support utility, if the metamodel support
such notifications.
eObjects - a list of newly created EObjectssendCreateEvent(EObject)
public static boolean isOkToSetEAttribute(EObject eObject,
EAttribute attribute,
java.lang.Object value)
eObject - the owner of the attributeattribute - an attribute to query whether it is settablevalue - the proposed new value of the attribute
true if the attribute is changeable
and the value is not null;
false, otherwise
public static void destroyEObject(EObject eObject,
EReference reference)
reference cannot be
cleared.
eObject - the element owning the reference to be clearedreference - the scalar reference to be clearedisOkToDestroyEObject(EObject, EReference)
public static void destroyEObjectInCollection(EObject eObject,
EReference reference,
EObject referencedObject)
reference cannot be
removed.
eObject - the element owning the reference list to be reducedreference - the many reference to be reducedreferencedObject - an object to remove from the listisOkToDestroyEObjectInCollection(EObject, EReference)public static void destroyEObjectInResource(EObject referencedObject)
referencedObject - an object to remove from the resource
public static boolean isOkToAppendEObjectAt(EObject eObject,
EReference reference,
EObject referencedObject)
EObject.
eObject - the owner of the referencereference - a many reference to query whether it is appendablereferencedObject - an object that is proposed to be appended
to the reference
true if the reference is changeable
and is not derived, and does not already contain the
referencedObject or appending it would not violate
the reference's declared upper bound;
false, otherwise
public static boolean isOkToSetEObject(EObject eObject,
EReference reference,
EObject referencedObject)
EObject.
eObject - the owner of the referencereference - a scalar reference to query whether it is settablereferencedObject - an object that is proposed to be assigned
to the reference
true if the reference is changeable
and is not derived, and does not already contain the
referencedObject or the referencedObject
is null; false, otherwise
public static boolean isOkToDestroyEObject(EObject eObject,
EReference reference)
eObject - the owner of the referencereference - a scalar reference to query whether it is clearable
true if the reference is changeable
and its value is not already null;
false, otherwise
public static boolean isOkToDestroyEObjectInCollection(EObject eObject,
EReference reference)
eObject - the owner of the referencereference - a many reference to query whether it is removable
true if the reference is changeable
and is not derived, and removing an element would not violate
its declared lower bound; false, otherwise
public static boolean isChild(EObject eParent,
EObject eObject)
eObject is contained within
another. This differs from the
EcoreUtil.isAncestor(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
method in checking for equality rather than identity.
eParent - an elementeObject - an element to see whether it is contained in the
eParent
true if the eObject is contained within
an element equal to the eParent;
false, otherwise
public static boolean hasNameCollision(EObject eObject1,
EObject eObject2)
eObject1 - an objecteObject2 - another object
true if both objects are nameable and have the
same name (ignoring case); false, otherwiseIClipboardSupport.isNameable(EObject)
public static boolean hasNameCollision(java.util.Collection list,
EObject eObject)
list.
list - a ist of objectseObject - another object
true if the eObjectis nameable and
has the same name (ignoring case) as any object in the
list; false, otherwiseIClipboardSupport.isNameable(EObject)
public static void rename(java.util.Collection list,
EObject eObject,
java.lang.String prefix)
list, renames it to have a unique name.
list - a list of objectseObject - another object whose name collides with the listprefix - the prefix to append; it will be modified by '_1', '_2',
etc. as necessaryhasNameCollision(Collection, EObject)
public static boolean containsAny(java.util.Collection collection1,
java.util.Collection collection2)
collection1 - a collectioncollection2 - another
true if they have any elements in common;
false, otherwise
public static EObject resolve(EObject proxy,
java.util.Map idToEObjectMap)
proxy, using the specified ID map. If a proxy
resolves to another proxy, then this procedure repeats until either a
non-proxy is found or it is not resolved.
proxy - a proxyidToEObjectMap - a mapping of element ID strings to EObjects
proxy (this is different from the behaviour of the
EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
method
public static EObject resolve(EObject proxy,
XMLResource resource)
proxy, using the specified resource. If a proxy
resolves to another proxy, then this procedure repeats until either a
non-proxy is found or it is not resolved.
proxy - a proxyresource - the resource containing a mapping of element ID strings to EObjects
proxy (this is different from the behaviour of the
EcoreUtil.resolve(org.eclipse.emf.ecore.EObject, org.eclipse.emf.ecore.EObject)
method
public static EReference getPasteContainmentFeature(EObject parentEObject,
EObject eObject,
EReference originalReference)
parentEObject - the target element into which a child is to be
pastedeObject - the child element to be pasted into the parentoriginalReference - the child's original containment reference
null if
child eObject simply cannot be contained by the
parentEObject
|
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.