public final class WorkspaceEditingDomainUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> |
getAllEditingDomains()
Returns all
editing domains that exist in the workspace. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getCurrentEditingDomain(org.eclipse.core.resources.IFile file)
Returns the
editing domain which currently contains the given file in its resource set. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(org.eclipse.emf.ecore.util.FeatureMap.Entry entry)
Returns the
editing domain for the value Object of the given FeatureMap.Entry. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(org.eclipse.core.resources.IContainer container,
IMetaModelDescriptor mmDescriptor)
Retrieves the
editing domain corresponding to the specified meta-model
descriptor for the given context container. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(org.eclipse.core.resources.IFile file)
Retrieves the
editing domain corresponding to the given file. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(IModelDescriptor modelDescriptor)
Retrieves the
editing domain behind given model
descriptor. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(org.eclipse.emf.edit.provider.IWrapperItemProvider wrapperItemProvider)
Retrieves the
editing domain corresponding to the object wrapped in the given
IWrapperItemProvider. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(java.lang.Object object)
Retrieves the
editing domain which the given object belongs to. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(TransientItemProvider provider)
Returns the
editing domain for the value Object of the given
ItemProviderAdapter. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getEditingDomain(org.eclipse.emf.common.util.URI uri)
Retrieves the EditingDomain by a URI.
|
static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> |
getEditingDomains(org.eclipse.core.resources.IContainer container)
Returns all
editing domains in the given container (i.e. |
static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> |
getEditingDomains(java.lang.String customURIScheme)
Returns the
editing domains of all metamodels that use URIs with given
customURIScheme in cross-document references and as proxy URIs. |
static org.eclipse.emf.transaction.TransactionalEditingDomain |
getMappedEditingDomain(org.eclipse.core.resources.IFile file)
Returns the
editing domain to which the given file is mapped. |
public static org.eclipse.emf.transaction.TransactionalEditingDomain getCurrentEditingDomain(org.eclipse.core.resources.IFile file)
editing domain which currently contains the given file in its resource set.file - The file whose current editing domain is to be
retrieved.editing domain which contains the given file, or
null if given file isn't contained in any editing domain.public static org.eclipse.emf.transaction.TransactionalEditingDomain getMappedEditingDomain(org.eclipse.core.resources.IFile file)
editing domain to which the given file is mapped.
The mapped editing domain is the editing
domain which is used as target when loading the file from the workspace.
Even though the mapped editing domain represents the primary
editing domain for the given file it still may happen that the
file gets loaded in another or "foreign" editing domain. Typical
reasons for this are e.g. lazy loading of one file from multiple other files which are in different
editing domains or programatic action by some application.
file - The file whose mapped editing domain is to be
retrieved.editing domain to which the given file is mapped, or
null if given file isn't mapped to any editing domain.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(java.lang.Object object)
editing domain which the given object belongs to.
The following types of objects are supported:
Note that it is not possible to obtain a single editing domain from a
IContainer. You can however retrieve the collection of editing
domains available on a IContainer by calling getEditingDomains(IContainer).
object - The object whose corresponding editing domain must be returned.object corresponds with or null if the
object cannot be mapped to an editing domain.WorkspaceEditingDomainManager.getEditingDomainMapping(),
getEditingDomains(IContainer)public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(IModelDescriptor modelDescriptor)
editing domain behind given model
descriptor.modelDescriptor - The model descriptor whose editing domain
is to be retrieved.editing domain behind given model
descriptor or null if no such could be retrieved.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.core.resources.IFile file)
editing domain corresponding to the given file.
Tries at first to determine the editing domain which currently contains the
given file in its resource set and returns it if successful. Otherwise, the
editing domain to which the given file is mapped is returned.file - The file whose is to be retrieved.editing domain the given file belongs to, or null if
given file doesn't belong to any editing domain.getCurrentEditingDomain(IFile),
getMappedEditingDomain(IFile)public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.emf.common.util.URI uri)
editing domain.uri - An URI (file, EMF Object's URI)editing domain associated with the given URI. Returns
null if the URI cannot be resolved to workspace file or no
editing domain can be mapped through the active mapping.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.emf.edit.provider.IWrapperItemProvider wrapperItemProvider)
editing domain corresponding to the object wrapped in the given
IWrapperItemProvider.wrapperItemProvider - The IWrapperItemProvider wrapping the Object for which the editing
domain is to be retrieved.editing domain the wrapped Object is associated with or
null if the Object cannot be mapped to an editing domain.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.emf.ecore.util.FeatureMap.Entry entry)
editing domain for the value Object of the given FeatureMap.Entry.entry - A FeatureMap.Entry holding the Object for which the editing domain
is to be retrieved.entry corresponds with or null
if the Object cannot be mapped to an editing domain.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(TransientItemProvider provider)
editing domain for the value Object of the given
ItemProviderAdapter.provider - An ItemProviderAdapter holding the Object for which the editing
domain is to be retrieved.provider corresponds with or null if the Object cannot be mapped to an
editing domain.public static org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.core.resources.IContainer container,
IMetaModelDescriptor mmDescriptor)
editing domain corresponding to the specified meta-model
descriptor for the given context container.container - The container to consider as context object in order to retrieve the right
editing domain.mmDescriptor - A meta-model descriptor.editing domain for the specified meta-model descriptor and the
specified context container or null if it cannot be mapped to any
editing domain.public static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> getEditingDomains(org.eclipse.core.resources.IContainer container)
editing domains in the given container (i.e.
workspace root, project or folder).editing domains in given container.public static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> getEditingDomains(java.lang.String customURIScheme)
editing domains of all metamodels that use URIs with given
customURIScheme in cross-document references and as proxy URIs.customURIScheme - The custom URI scheme to retrieve the editing domains for.public static java.util.Collection<org.eclipse.emf.transaction.TransactionalEditingDomain> getAllEditingDomains()
editing domains that exist in the workspace.
This is a convenience method, fully equivalent to:
WorkspaceEditingDomainUtil.getEditingDomains(ResourcesPlugin.getWorkspace().getRoot());* @return The collection of
editing domains in the workspace.