public class CheckConditionsOperation extends Object implements IWorkspaceRunnable
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.
Refactoring.checkInitialConditions(IProgressMonitor)
,
Refactoring.checkFinalConditions(IProgressMonitor)
,
Refactoring.checkAllConditions(IProgressMonitor)
Modifier and Type | Field and Description |
---|---|
static int |
ALL_CONDITIONS
Flag indicating that all conditions will be checked
|
static int |
FINAL_CONDITIONS
Flag indicating that only final conditions will be checked
|
static int |
INITIAL_CONDITONS
Flag indicating that only initial conditions will be checked
|
static int |
NONE
Flag indicating that no conditions will be checked
|
Constructor and Description |
---|
CheckConditionsOperation(Refactoring refactoring,
int style)
Creates a new
CheckConditionsOperation . |
Modifier and Type | Method and Description |
---|---|
Refactoring |
getRefactoring()
Returns the operation's refactoring
|
RefactoringStatus |
getStatus()
Returns the outcome of the operation or
null 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.
|
public static final int NONE
public static final int INITIAL_CONDITONS
public static final int FINAL_CONDITIONS
public static final int ALL_CONDITIONS
public CheckConditionsOperation(Refactoring refactoring, int style)
CheckConditionsOperation
.refactoring
- the refactoring for which the preconditions are to
be checked.style
- style to define which conditions to check. Must be one of
INITIAL_CONDITONS
, FINAL_CONDITIONS
or
ALL_CONDITIONS
public void run(IProgressMonitor pm) throws CoreException
ICoreRunnable
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
. A CoreException
with a status
of severity IStatus.CANCEL
has the same effect as
an OperationCanceledException
.
run
in interface IWorkspaceRunnable
run
in interface ICoreRunnable
pm
- a progress monitor, or null
if progress reporting and
cancellation are not desired. The monitor is only valid for the duration
of the invocation of this method. Callers may call IProgressMonitor.done()
after this method returns or throws an exception, but this is not strictly
required.CoreException
- if this operation failspublic RefactoringStatus getStatus()
null
if an exception
has occurred while performing the operation or if the operation hasn't
been performed yet.RefactoringStatus
of the condition checkingpublic Refactoring getRefactoring()
public int getStyle()
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.