public abstract class AbstractResourceScopeProvider extends java.lang.Object implements IResourceScopeProvider
IResourceScopeProvider
implementation providing common behavior an overriding points.Constructor and Description |
---|
AbstractResourceScopeProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract IResourceScope |
createScope(org.eclipse.core.resources.IResource resource)
Creates a new
resource scope for given workspace resource. |
IResourceScope |
getScope(org.eclipse.core.resources.IResource resource)
Returns an
resource scope for given workspace resource . |
IResourceScope |
getScope(org.eclipse.emf.ecore.resource.Resource resource)
Returns an
resource scope for given model resource . |
boolean |
hasApplicableFileExtension(org.eclipse.core.resources.IFile file)
Tests if the given
file 's extension corresponds to a file type which is subject to
resource scope provider . |
boolean |
isApplicableTo(org.eclipse.core.resources.IFile file)
Tests if this
resource scope provider is applicable to given file ,
i.e., if this resource scope provider is able or likely to be able to provide a
resource scope for the given file . |
org.eclipse.emf.common.util.Diagnostic |
validate(org.eclipse.core.resources.IFile file)
Validates given
workspace file with regard to their resource scope and
returns a diagnostic as validation result. |
public boolean isApplicableTo(org.eclipse.core.resources.IFile file)
IResourceScopeProvider
resource scope provider
is applicable to given file
,
i.e., if this resource scope provider
is able or likely to be able to provide a
resource scope
for the given file
. This typically involves testing if a
resource scope
can be created for given file
, exists, and
is applicable
to file
s having the extension of the given
file
.
This method is guaranteed to have a very little performance overhead.
isApplicableTo
in interface IResourceScopeProvider
file
- The file
to be investigated.true
if this resource scope provider
is applicable to given
file
, false
otherwise.IResourceScopeProvider.hasApplicableFileExtension(IFile)
public boolean hasApplicableFileExtension(org.eclipse.core.resources.IFile file)
IResourceScopeProvider
file
's extension corresponds to a file type which is subject to
resource scope provider
.
This method is guaranteed to have a very little performance overhead.
hasApplicableFileExtension
in interface IResourceScopeProvider
file
- The file
to be investigated.true
if this resource scope provider
is applicable to
file
s having the extension of the given file
, false
otherwise.IResourceScopeProvider.isApplicableTo(IFile)
public IResourceScope getScope(org.eclipse.core.resources.IResource resource)
IResourceScopeProvider
resource scope
for given workspace resource
.getScope
in interface IResourceScopeProvider
resource
- The workspace resource
to retrieve the resource scope
for.resource scope
for given workspace resource
.protected abstract IResourceScope createScope(org.eclipse.core.resources.IResource resource)
resource scope
for given workspace resource.resource
- The workspace resource
to create the resource scope
for.resource scope
.public IResourceScope getScope(org.eclipse.emf.ecore.resource.Resource resource)
IResourceScopeProvider
resource scope
for given model resource
.getScope
in interface IResourceScopeProvider
resource
- The model resource
to retrieve the resource scope
for.resource scope
for given model resource
.public org.eclipse.emf.common.util.Diagnostic validate(org.eclipse.core.resources.IFile file)
IResourceScopeProvider
workspace file
with regard to their resource scope
and
returns a diagnostic
as validation result.validate
in interface IResourceScopeProvider
Diagnostic
indicating resource scoping
related problems, if any, or
Diagnostic.OK_INSTANCE
otherwise.