public class DefaultResourceScope extends java.lang.Object implements IResourceScope
IResourceScope
interface.
Clients that wish to implement custom resource scopes can extend this class and override only the methods which they are interested in.
IResourceScope
Constructor and Description |
---|
DefaultResourceScope() |
Modifier and Type | Method and Description |
---|---|
boolean |
belongsTo(org.eclipse.core.resources.IFile file,
boolean includeReferencedScopes)
Determines if given
file belongs to this scope. |
boolean |
belongsTo(org.eclipse.emf.ecore.resource.Resource resource,
boolean includeReferencedScopes)
Determines if given
resource belongs to this scope. |
boolean |
belongsTo(org.eclipse.emf.common.util.URI uri,
boolean includeReferencedScopes)
Determines if given
uri references a resource that belongs to this scope. |
boolean |
didBelongTo(org.eclipse.core.resources.IFile file,
boolean includeReferencedScopes)
Determines if given
file not belonging to this resource scope did belong to it before. |
boolean |
didBelongTo(org.eclipse.emf.ecore.resource.Resource resource,
boolean includeReferencedScopes)
Determines if given
resource not belonging to this resource scope did belong to it before. |
boolean |
didBelongTo(org.eclipse.emf.common.util.URI uri,
boolean includeReferencedScopes)
Determines if given
uri did reference a resource that does no longer belong to this
resource scope but did so before. |
boolean |
exists()
Returns true if this
resource scope exists. |
java.util.Collection<org.eclipse.emf.ecore.resource.Resource> |
getLoadedResources(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain,
boolean includeReferencedScopes)
Returns
resource s loaded in the given editing domain being part of that scope. |
java.util.Collection<org.eclipse.core.resources.IFile> |
getPersistedFiles(boolean includeReferencedScopes)
Returns all the files in this scope persisted in the workspace.
|
java.util.Collection<org.eclipse.core.resources.IResource> |
getReferencedRoots()
Returns the roots of other
resource scope s which are referenced by this
resource scope . |
java.util.Collection<org.eclipse.core.resources.IResource> |
getReferencingRoots()
Returns the roots of other
resource scope s which reference this resource scope . |
org.eclipse.core.resources.IResource |
getRoot()
Returns the root
IResource of that resource scope . |
boolean |
isShared(org.eclipse.core.resources.IFile file)
Determines if given
file is shared among multiple resource scopes, i.e., can simultaneously belong
to multiple resource scopes, or not. |
boolean |
isShared(org.eclipse.emf.ecore.resource.Resource resource)
Determines if given
resource is shared among multiple resource scopes, i.e., can simultaneously
belong to multiple resource scopes, or not. |
boolean |
isShared(org.eclipse.emf.common.util.URI uri)
Determines if given
URI is shared among multiple resource scopes, i.e., can simultaneously belong to
multiple resource scopes, or not. |
public boolean exists()
IResourceScope
resource scope
exists.
This method is guaranteed to have a very little performance overhead.
exists
in interface IResourceScope
true
if the model exist (i.e if all user defined conditions required are full filled)public org.eclipse.core.resources.IResource getRoot()
IResourceScope
IResource
of that resource scope
.getRoot
in interface IResourceScope
resource
of that scope.public java.util.Collection<org.eclipse.core.resources.IResource> getReferencedRoots()
IResourceScope
resource scope
s which are referenced by this
resource scope
.getReferencedRoots
in interface IResourceScope
Collection
of resources containing all resource scope
's roots referenced
by this scope.public java.util.Collection<org.eclipse.core.resources.IResource> getReferencingRoots()
IResourceScope
resource scope
s which reference this resource scope
.getReferencingRoots
in interface IResourceScope
Collection
of workspac resources
containing all resource
scope
's roots referencing this scope.public java.util.Collection<org.eclipse.core.resources.IFile> getPersistedFiles(boolean includeReferencedScopes)
IResourceScope
getPersistedFiles
in interface IResourceScope
includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.Collection
of persisted file
s owned by this scope.public java.util.Collection<org.eclipse.emf.ecore.resource.Resource> getLoadedResources(org.eclipse.emf.transaction.TransactionalEditingDomain editingDomain, boolean includeReferencedScopes)
IResourceScope
resource
s loaded in the given editing domain being part of that scope.getLoadedResources
in interface IResourceScope
editingDomain
- The editing domain
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.Collection
of resource
s owned by this scope and loaded in the provided
editing domain
.public boolean belongsTo(org.eclipse.core.resources.IFile file, boolean includeReferencedScopes)
IResourceScope
file
belongs to this scope.belongsTo
in interface IResourceScope
file
- The file
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the file
is in this resource scope, or false
otherwise.public boolean belongsTo(org.eclipse.emf.ecore.resource.Resource resource, boolean includeReferencedScopes)
IResourceScope
resource
belongs to this scope.belongsTo
in interface IResourceScope
resource
- The resource
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the resource
is in this resource scope, or false
otherwise.public boolean belongsTo(org.eclipse.emf.common.util.URI uri, boolean includeReferencedScopes)
IResourceScope
uri
references a resource
that belongs to this scope.belongsTo
in interface IResourceScope
uri
- The uri
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the uri
is in this resource scope, or false
otherwise.public boolean didBelongTo(org.eclipse.core.resources.IFile file, boolean includeReferencedScopes)
IResourceScope
file
not belonging to this resource scope did belong to it before.didBelongTo
in interface IResourceScope
file
- The file
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the file
was in this resource scope, or false
otherwise.public boolean didBelongTo(org.eclipse.emf.ecore.resource.Resource resource, boolean includeReferencedScopes)
IResourceScope
resource
not belonging to this resource scope did belong to it before.didBelongTo
in interface IResourceScope
resource
- The resource
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the resource
was in this resource scope, or false
otherwise.public boolean didBelongTo(org.eclipse.emf.common.util.URI uri, boolean includeReferencedScopes)
IResourceScope
uri
did reference a resource
that does no longer belong to this
resource scope but did so before.didBelongTo
in interface IResourceScope
uri
- The uri
to be investigated.includeReferencedScopes
- Determines if scopes referenced by the current resource scope
must be
investigated.true
if the uri
was in this resource scope, or false
otherwise.public boolean isShared(org.eclipse.core.resources.IFile file)
IResourceScope
file
is shared among multiple resource scopes, i.e., can simultaneously belong
to multiple resource scopes, or not.isShared
in interface IResourceScope
file
- The file to be investigated.true
if given file is shared across multiple resource scopes, or false
otherwise.public boolean isShared(org.eclipse.emf.ecore.resource.Resource resource)
IResourceScope
resource
is shared among multiple resource scopes, i.e., can simultaneously
belong to multiple resource scopes, or not.isShared
in interface IResourceScope
true
if given resource is shared across multiple resource scopes, or false
otherwise.public boolean isShared(org.eclipse.emf.common.util.URI uri)
IResourceScope
URI
is shared among multiple resource scopes, i.e., can simultaneously belong to
multiple resource scopes, or not.isShared
in interface IResourceScope
true
if the resource behind given URI is shared across multiple resource scopes, or
false
otherwise.