Package org.eclipse.ltk.core.refactoring
Class CheckConditionsOperation
- java.lang.Object
-
- org.eclipse.ltk.core.refactoring.CheckConditionsOperation
-
- All Implemented Interfaces:
IWorkspaceRunnable,ICoreRunnable
public class CheckConditionsOperation extends Object implements IWorkspaceRunnable
Operation that, when run, checks the preconditions of theRefactoringpassed on creation.The operation should be executed via the run method offered by
IWorkspaceto achieve proper delta batching.Note: this class is not intended to be extended by clients.
- Since:
- 3.0
- See Also:
Refactoring.checkInitialConditions(IProgressMonitor),Refactoring.checkFinalConditions(IProgressMonitor),Refactoring.checkAllConditions(IProgressMonitor)- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Field Summary
Fields Modifier and Type Field Description static intALL_CONDITIONSFlag indicating that all conditions will be checkedstatic intFINAL_CONDITIONSFlag indicating that only final conditions will be checkedstatic intINITIAL_CONDITONSFlag indicating that only initial conditions will be checkedstatic intNONEFlag indicating that no conditions will be checked
-
Constructor Summary
Constructors Constructor Description CheckConditionsOperation(Refactoring refactoring, int style)Creates a newCheckConditionsOperation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RefactoringgetRefactoring()Returns the operation's refactoringRefactoringStatusgetStatus()Returns the outcome of the operation ornullif an exception has occurred while performing the operation or if the operation hasn't been performed yet.intgetStyle()Returns the condition checking style.voidrun(IProgressMonitor pm)Executes this runnable.
-
-
-
Field Detail
-
NONE
public static final int NONE
Flag indicating that no conditions will be checked- See Also:
- Constant Field Values
-
INITIAL_CONDITONS
public static final int INITIAL_CONDITONS
Flag indicating that only initial conditions will be checked- See Also:
- Constant Field Values
-
FINAL_CONDITIONS
public static final int FINAL_CONDITIONS
Flag indicating that only final conditions will be checked- See Also:
- Constant Field Values
-
ALL_CONDITIONS
public static final int ALL_CONDITIONS
Flag indicating that all conditions will be checked- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CheckConditionsOperation
public CheckConditionsOperation(Refactoring refactoring, int style)
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_CONDITIONSorALL_CONDITIONS
-
-
Method Detail
-
run
public void run(IProgressMonitor pm) throws CoreException
Description copied from interface:ICoreRunnableExecutes 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. ACoreExceptionwith a status of severityIStatus.CANCELhas the same effect as anOperationCanceledException.- Specified by:
runin interfaceICoreRunnable- Specified by:
runin interfaceIWorkspaceRunnable- Parameters:
pm- a progress monitor, ornullif 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
public RefactoringStatus getStatus()
Returns the outcome of the operation ornullif an exception has occurred while performing the operation or if the operation hasn't been performed yet.- Returns:
- the
RefactoringStatusof the condition checking
-
getRefactoring
public Refactoring 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
-
-