public class CreateChangeOperation extends Object implements IWorkspaceRunnable
Changeobject for a given refactoring. If created with a refactoring object directly, no precondition checking is performed. If created with a
CheckConditionsOperationthe requested precondition checking is performed before creating the change.
If the precondition checking returns a fatal error or the status's severity exceeds a certain threshold then no change will be created.
If a change has been created the operation calls
to initialize the change's validation data.
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.
|Constructor and Description|
Creates a new operation with the given
Creates a new operation with the given refactoring.
|Modifier and Type||Method and Description|
Returns the outcome of the operation or
Returns the condition checking failed severity used by this operation.
Returns the status of the condition checking.
Returns the condition checking style as set to the
Executes this runnable.
public CreateChangeOperation(Refactoring refactoring)
refactoring- the refactoring for which the change is to be created
public CreateChangeOperation(CheckConditionsOperation operation, int checkFailedSeverity)
CheckConditionsOperation. When performed the operation first checks the conditions as specified by the
CheckConditionsOperation. Depending on the result of the condition checking a change object is created or not.
operation- the condition checking operation
checkFailedSeverity- the severity from which on the condition checking is interpreted as failed. The passed value must be greater than
RefactoringStatus.OKand less than or equal
RefactoringStatus.FATAL. The standard value from which on a condition check should is to be interpreted as failed can be accessed via
public int getConditionCheckingFailedSeverity()
public void run(IProgressMonitor pm) throws CoreException
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
CoreException with a status
IStatus.CANCEL has the same effect as
pm- a progress monitor, or
nullif 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 fails
public Change getChange()
nullif an exception occurred when performing the operation or the operation hasn't been performed yet.
public RefactoringStatus getConditionCheckingStatus()
nullif no condition checking has been requested.
public int getConditionCheckingStyle()
CheckConditionsOperation. If no condition checking operation is provided (e.g. the change is created directly by calling
Copyright (c) 2000, 2017 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.