Package org.eclipse.ltk.core.refactoring
Class CheckConditionsOperation
java.lang.Object
org.eclipse.ltk.core.refactoring.CheckConditionsOperation
- All Implemented Interfaces:
IWorkspaceRunnable
,ICoreRunnable
Operation that, when run, checks the preconditions of the
Refactoring
passed on creation.
The operation should be executed via the run method offered by
IWorkspace
to achieve proper delta batching.
Note: this class is not intended to be extended by clients.
- Since:
- 3.0
- See Also:
- Restriction:
- This class is not intended to be subclassed by clients.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Flag indicating that all conditions will be checkedstatic final int
Flag indicating that only final conditions will be checkedstatic final int
Flag indicating that only initial conditions will be checkedstatic final int
Flag indicating that no conditions will be checked -
Constructor Summary
ConstructorDescriptionCheckConditionsOperation
(Refactoring refactoring, int style) Creates a newCheckConditionsOperation
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the operation's refactoringReturns the outcome of the operation ornull
if an exception has occurred while performing the operation or if the operation hasn't been performed yet.int
getStyle()
Returns the condition checking style.void
run
(IProgressMonitor pm) Executes this runnable.
-
Field Details
-
NONE
public static final int NONEFlag indicating that no conditions will be checked- See Also:
-
INITIAL_CONDITONS
public static final int INITIAL_CONDITONSFlag indicating that only initial conditions will be checked- See Also:
-
FINAL_CONDITIONS
public static final int FINAL_CONDITIONSFlag indicating that only final conditions will be checked- See Also:
-
ALL_CONDITIONS
public static final int ALL_CONDITIONSFlag indicating that all conditions will be checked- See Also:
-
-
Constructor Details
-
CheckConditionsOperation
Creates a newCheckConditionsOperation
.- Parameters:
refactoring
- the refactoring for which the preconditions are to be checked.style
- style to define which conditions to check. Must be one ofINITIAL_CONDITONS
,FINAL_CONDITIONS
orALL_CONDITIONS
-
-
Method Details
-
run
Description copied from interface:ICoreRunnable
Executes this runnable.The provided monitor can be used to report progress and respond to cancellation. If the progress monitor has been canceled, the runnable should finish its execution at the earliest convenience and throw an
OperationCanceledException
. ACoreException
with a status of severityIStatus.CANCEL
has the same effect as anOperationCanceledException
.- Specified by:
run
in interfaceICoreRunnable
- Specified by:
run
in interfaceIWorkspaceRunnable
- Parameters:
pm
- a progress monitor, ornull
if progress reporting and cancellation are not desired. The monitor is only valid for the duration of the invocation of this method. Callers may callIProgressMonitor.done()
after this method returns or throws an exception, but this is not strictly required.- Throws:
CoreException
- if this operation fails
-
getStatus
Returns the outcome of the operation ornull
if an exception has occurred while performing the operation or if the operation hasn't been performed yet.- Returns:
- the
RefactoringStatus
of the condition checking
-
getRefactoring
Returns the operation's refactoring- Returns:
- the operation's refactoring
-
getStyle
public int getStyle()Returns the condition checking style.- Returns:
- the condition checking style
-