|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.core.resources.mapping.ModelProvider
public abstract class ModelProvider
Represents the provider of a logical model. The main purpose of this
API is to support batch operations on sets of ResourceMapping
objects that are part of the same model.
This class may be subclassed by clients.
ResourceMapping
Field Summary | |
---|---|
static java.lang.String |
RESOURCE_MODEL_PROVIDER_ID
The model provider id of the Resources model. |
Constructor Summary | |
---|---|
ModelProvider()
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
IModelProviderDescriptor |
getDescriptor()
Return the descriptor of this model provider. |
java.lang.String |
getId()
Returns the unique identifier of this model provider. |
ResourceMapping[] |
getMappings(IResource[] resources,
ResourceMappingContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Return the set of mappings that cover the given resources. |
ResourceMapping[] |
getMappings(IResource resource,
ResourceMappingContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Return the resource mappings that cover the given resource. |
ResourceMapping[] |
getMappings(ResourceTraversal[] traversals,
ResourceMappingContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Return the set of mappings that overlap with the given resource traversals. |
static IModelProviderDescriptor |
getModelProviderDescriptor(java.lang.String id)
Return the descriptor for the model provider of the given id or null if the provider has not been registered. |
static IModelProviderDescriptor[] |
getModelProviderDescriptors()
Return the descriptors for all model providers that are registered. |
ResourceTraversal[] |
getTraversals(ResourceMapping[] mappings,
ResourceMappingContext context,
org.eclipse.core.runtime.IProgressMonitor monitor)
Return a set of traversals that cover the given resource mappings. |
int |
hashCode()
|
void |
init(IModelProviderDescriptor desc)
This method is called by the model provider framework when the model provider is instantiated. |
org.eclipse.core.runtime.IStatus |
validateChange(IResourceDelta delta,
org.eclipse.core.runtime.IProgressMonitor monitor)
Validate the proposed changes contained in the given delta. |
Methods inherited from class org.eclipse.core.runtime.PlatformObject |
---|
getAdapter |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RESOURCE_MODEL_PROVIDER_ID
Constructor Detail |
---|
public ModelProvider()
Method Detail |
---|
public static IModelProviderDescriptor getModelProviderDescriptor(java.lang.String id)
null
if the provider has not been registered.
id
- a model provider id.
null
if the provider has not been registeredpublic static IModelProviderDescriptor[] getModelProviderDescriptors()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public final IModelProviderDescriptor getDescriptor()
initialize
method is invoked.
public final java.lang.String getId()
The model provider identifier is composed of the model provider's
plug-in id and the simple id of the provider extension. For example, if
plug-in "com.xyz"
defines a provider extension with id
"myModelProvider"
, the unique model provider identifier will be
"com.xyz.myModelProvider"
.
public ResourceMapping[] getMappings(IResource resource, ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
getMappings(IResource[], ResourceMappingContext, IProgressMonitor)
or (getMappings(ResourceTraversal[], ResourceMappingContext, IProgressMonitor)
if more context is needed to determine the proper mappings.
resource
- the resourcecontext
- a resource mapping contextmonitor
- a progress monitor, or null
if progress
reporting is not desired
org.eclipse.core.runtime.CoreException
public ResourceMapping[] getMappings(IResource[] resources, ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
getMapping(IResource)
for each resource.
Subclasses may override this method.
resources
- the resourcescontext
- a resource mapping contextmonitor
- a progress monitor, or null
if progress
reporting is not desired
org.eclipse.core.runtime.CoreException
public ResourceMapping[] getMappings(ResourceTraversal[] traversals, ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
getMappings(IResource[], ResourceMappingContext, IProgressMonitor)
with the resources extract from each traversal.
Subclasses may override this method.
traversals
- the traversalscontext
- a resource mapping contextmonitor
- a progress monitor, or null
if progress
reporting is not desired
org.eclipse.core.runtime.CoreException
public ResourceTraversal[] getTraversals(ResourceMapping[] mappings, ResourceMappingContext context, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException
The default implementation accumulates the traversals from the given mappings. Subclasses can override to provide a more optimal transformation.
mappings
- the mappings being mapped to resourcescontext
- the context used to determine the set of traversals that
cover the mappingsmonitor
- a progress monitor, or null
if progress
reporting is not desired
org.eclipse.core.runtime.CoreException
public int hashCode()
hashCode
in class java.lang.Object
public final void init(IModelProviderDescriptor desc)
initialize
method once the descriptor is set so subclasses
can override that method if they need to do additional initialization.
desc
- the description of the provider as it appears in the plugin manifestpublic org.eclipse.core.runtime.IStatus validateChange(IResourceDelta delta, org.eclipse.core.runtime.IProgressMonitor monitor)
This method must return either a ModelStatus
, or a MultiStatus
whose children are ModelStatus
. The severity of the returned status
indicates the severity of the possible side-effects of the operation. Any
severity other than OK
will be shown to the user. The
message should be a human readable message that will allow the user to
make a decision on whether to continue with the operation. The model
provider id should indicate which model is flagging the possible side effects.
This default implementation accepts all changes and returns a status with
severity OK
. Subclasses should override to perform
validation specific to their model.
delta
- a delta tree containing the proposed changesmonitor
- a progress monitor, or null
if progress
reporting is not desired
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |