public final class ResourceChangeValidator extends Object
The validator is used by first creating a resource delta describing the
proposed changes. A delta can be generated using a
The change is then validated by calling the
method. This example validates a change to a single file:
IFile file = ..;//some file that is going to be changed
ResourceChangeValidator validator = ResourceChangeValidator.getValidator();
IResourceChangeDescriptionFactory factory = validator.createDeltaFactory();
IResourceDelta delta = factory.getDelta();
IStatus result = validator.validateChange(delta, null);
If the result status does not have severity
the changes may cause problems for models that are built on those
resources. In this case the user should be presented with the status message
to determine if they want to proceed with the modification.
|Modifier and Type||Method and Description|
Return an empty change description factory that can be used to build a proposed resource delta.
Return the singleton change validator.
Validate the proposed changes contained in the given delta by consulting all model providers to determine if the changes have any adverse side effects.
public static ResourceChangeValidator getValidator()
public IResourceChangeDescriptionFactory createDeltaFactory()
public IStatus validateChange(IResourceDelta delta, IProgressMonitor monitor)
This method returns either a
ModelStatus, or a
whose children are
ModelStatus. In either case, the severity
of the status indicates the severity of the possible side-effects of
the operation. Any severity other than
OK should 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
the possible side effects.
delta- a delta tree containing the proposed changes
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.