public class PerformRefactoringHistoryOperation extends Object implements IWorkspaceRunnable
PerformRefactoringOperation
.
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 instantiated or extended outside of the refactoring framework.
IWorkspace
,
PerformRefactoringOperation
,
RefactoringHistory
,
RefactoringHistoryService
Constructor and Description |
---|
PerformRefactoringHistoryOperation(RefactoringHistory history)
Creates a new perform refactoring history operation.
|
Modifier and Type | Method and Description |
---|---|
protected RefactoringStatus |
aboutToPerformRefactoring(Refactoring refactoring,
RefactoringDescriptor descriptor,
IProgressMonitor monitor)
Hook method which is called when the specified refactoring is going to be
executed.
|
protected Refactoring |
createRefactoring(RefactoringDescriptor descriptor,
RefactoringStatus status)
Method which is called to create a refactoring instance from a
refactoring descriptor.
|
RefactoringStatus |
getExecutionStatus()
Returns the execution status.
|
protected void |
refactoringPerformed(Refactoring refactoring,
IProgressMonitor monitor)
Hook method which is called when the specified refactoring has been
performed.
|
void |
run(IProgressMonitor monitor)
Runs the operation reporting progress to and accepting
cancellation requests from the given progress monitor.
|
public PerformRefactoringHistoryOperation(RefactoringHistory history)
history
- the refactoring historyprotected RefactoringStatus aboutToPerformRefactoring(Refactoring refactoring, RefactoringDescriptor descriptor, IProgressMonitor monitor)
refactoring
- the refactoring about to be executeddescriptor
- the refactoring descriptormonitor
- the progress monitor to useprotected Refactoring createRefactoring(RefactoringDescriptor descriptor, RefactoringStatus status) throws CoreException
descriptor
- the refactoring descriptorstatus
- a refactoring status to describe the outcome of the
initializationnull
if this refactoring
descriptor represents the unknown refactoring, or if no
refactoring contribution is available for this refactoring
descriptorCoreException
- if an error occurs while creating the refactoring instancepublic final RefactoringStatus getExecutionStatus()
null
.protected void refactoringPerformed(Refactoring refactoring, IProgressMonitor monitor)
refactoring
- the refactoring which has been performedmonitor
- the progress monitor to usepublic void run(IProgressMonitor monitor) throws CoreException
Implementors of this method should check the progress monitor
for cancellation when it is safe and appropriate to do so. The cancellation
request should be propagated to the caller by throwing
OperationCanceledException
.
run
in interface IWorkspaceRunnable
monitor
- a progress monitor, or null
if progress
reporting and cancellation are not desiredCoreException
- if this operation fails.Guidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.