public class PerformChangeOperation extends Object implements IWorkspaceRunnable
Changeobject. The operation can be created in two different ways: with a given change or with a
CreateChangeOperation. If created the second way the given create change operation will be used to create the actual change to perform.
If the change has been performed successfully (e.g.
true) then the operation has called
Change.dispose() as well
to clear-up internal state in the change object. If it hasn't been executed the
change, the change is still intact and the client is responsible to dispose the
If an undo change has been provided by the change to execute then the operation
Change.initializeValidationData(IProgressMonitor) to initialize the
undo change's validation data.
If an undo manager has been set via the method
then the undo object, if any has been provided, will be pushed onto the manager's
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 outside of the refactoring framework.
|Constructor and Description|
Creates a new perform change operation instance for the given change.
Creates a new
|Modifier and Type||Method and Description|
Actually executes the change.
Returns the change used by this operation.
Returns the status of the condition checking.
Returns the undo change of the change performed by this operation.
Returns the refactoring status returned from the call
Executes this runnable.
Sets the scheduling rule used to execute this operation.
Sets the undo manager.
public PerformChangeOperation(Change change)
change- the change to be applied to the workbench
public PerformChangeOperation(CreateChangeOperation op)
PerformChangeOperationfor the given
CreateChangeOperation. The create change operation is used to create the actual change to execute.
CreateChangeOperationused to create the actual change object
public boolean changeExecutionFailed()
trueif the change execution failed.
trueif the change execution failed;
public boolean changeExecuted()
trueif the change has been executed. Otherwise
trueif the change has been executed, otherwise
public RefactoringStatus getConditionCheckingStatus()
nullif no condition checking has been requested.
public Change getChange()
CreateChangeOperation. Method returns
nullif the create operation did not create a corresponding change or hasn't been executed yet.
nullif no change has been created
public Change getUndoChange()
nullif the change hasn't been performed yet or if the change doesn't provide a undo.
public RefactoringStatus getValidationStatus()
nullif the change has not been executed.
public void setUndoManager(IUndoManager manager, String undoName)
manager- the undo manager to use or
nullif no undo recording is desired
undoName- the name used to present the undo change on the undo stack. Must be a human-readable string. Must not be
nullif manager is unequal
public void setSchedulingRule(ISchedulingRule rule)
rule- the rule to use, or
nullto use no scheduling rule
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
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.