|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.workspace.ResourceUndoContext
public final class ResourceUndoContext
An IUndoContext that tags an EMF operation with a resource affected by it.
Two resource contexts match if and only if they reference the same Resource
instance. An operation may have any number of distinct resource contexts.
The determination of which resource is affected by any atomic EMF change is obvious, except for the case of cross-resource reference changes. When a cross-resource reference is added or removed, then both the referencing and referenced resources are considered to be affected, even if the reference is unidirectional. The assumption is that even without the back-reference, there is an implicit dependency in that direction.
| Constructor Summary | |
|---|---|
ResourceUndoContext(TransactionalEditingDomain domain,
org.eclipse.emf.ecore.resource.Resource resource)
Initializes me with the editing domain that owns a resource and the resource that I represent. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
I am equal to other ResourceUndoContexts on the same
resource as mine. |
static Set<org.eclipse.emf.ecore.resource.Resource> |
getAffectedResources(IUndoableOperation operation)
Extracts the set of EMF Resources affected by the specified
operation, from the ResourceUndoContexts attached to it. |
static Set<org.eclipse.emf.ecore.resource.Resource> |
getAffectedResources(List<? extends org.eclipse.emf.common.notify.Notification> notifications)
Deprecated. Since the 1.3 release, use the IResourceUndoContextPolicy.getContextResources(IUndoableOperation, List)
method of the editing domain's resource undo-context policy,
instead |
TransactionalEditingDomain |
getEditingDomain()
Obtains the editing domain that manages my resource. |
String |
getLabel()
|
org.eclipse.emf.ecore.resource.Resource |
getResource()
Obtains the resource that I represent. |
int |
hashCode()
|
boolean |
matches(IUndoContext context)
I match another context if it is a
ResourceUndoContext representing the same resource as I. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceUndoContext(TransactionalEditingDomain domain,
org.eclipse.emf.ecore.resource.Resource resource)
domain - the editing domainresource - the resource that I represent| Method Detail |
|---|
public String getLabel()
getLabel in interface IUndoContextpublic boolean matches(IUndoContext context)
context if it is a
ResourceUndoContext representing the same resource as I.
matches in interface IUndoContextpublic boolean equals(Object o)
ResourceUndoContexts on the same
resource as mine.
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic org.eclipse.emf.ecore.resource.Resource getResource()
public final TransactionalEditingDomain getEditingDomain()
public static Set<org.eclipse.emf.ecore.resource.Resource> getAffectedResources(List<? extends org.eclipse.emf.common.notify.Notification> notifications)
IResourceUndoContextPolicy.getContextResources(IUndoableOperation, List)
method of the editing domain's resource undo-context policy,
instead
Resources
affected by the changes.
notifications - a list of Notifications indicating changes in a
resource set
public static Set<org.eclipse.emf.ecore.resource.Resource> getAffectedResources(IUndoableOperation operation)
Resources affected by the specified
operation, from the ResourceUndoContexts attached to it.
operation - an undoable operation
Resources that it affects, or an empty set if none.
The resulting set should be treated as unmodifiablepublic String toString()
toString in class Object
|
Copyright 2002, 2007 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||