Class CheckConditionsContext
java.lang.Object
org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext
A context that is shared between the refactoring processor and all its
associated participants during condition checking.
The context manages a set of IConditionChecker
objects to collect
condition checks that should be perform across all participants and the
processor. For example validating if a file can be changed (see
IWorkspace.validateEdit(org.eclipse.core.resources.IFile[], java.lang.Object)
should only be called once for all files modified by the processor and all
participants.
Note: this class is not intended to be extended by clients.
- Since:
- 3.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(IConditionChecker checker) Adds the given condition checker.Checks the condition of all registered condition checkers and returns a merge status result.<T extends IConditionChecker>
TgetChecker
(Class<T> clazz) Returns the condition checker of the given type.
-
Constructor Details
-
CheckConditionsContext
public CheckConditionsContext()
-
-
Method Details
-
getChecker
Returns the condition checker of the given type.- Parameters:
clazz
- the type of the condition checker- Returns:
- the condition checker or
null
if no checker is registered for the given type
-
add
Adds the given condition checker. An exception will be thrown if a checker of the same type already exists in this context.- Parameters:
checker
- the checker to add- Throws:
CoreException
- if a checker of the same type already exists
-
check
Checks the condition of all registered condition checkers and returns a merge status result.- Parameters:
pm
- a progress monitor ornull
if no progress reporting is desired- Returns:
- the combined status result
- Throws:
CoreException
- if an error occurs during condition checking
-