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)
Deprecated.
since 3.4. Override
createRefactoring(RefactoringDescriptor, RefactoringStatus, IProgressMonitor) instead |
protected Refactoring |
createRefactoring(RefactoringDescriptor descriptor,
RefactoringStatus status,
IProgressMonitor monitor)
Deprecated.
since 3.6. Override
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor) instead |
protected RefactoringContext |
createRefactoringContext(RefactoringDescriptor descriptor,
RefactoringStatus status,
IProgressMonitor monitor)
Method which is called to create a refactoring context 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
createRefactoring(RefactoringDescriptor, RefactoringStatus, IProgressMonitor)
insteaddescriptor
- 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 instanceprotected Refactoring createRefactoring(RefactoringDescriptor descriptor, RefactoringStatus status, IProgressMonitor monitor) throws CoreException
createRefactoringContext(RefactoringDescriptor, RefactoringStatus, IProgressMonitor)
insteaddescriptor
- the refactoring descriptorstatus
- a refactoring status to describe the outcome of the
initializationmonitor
- the progress monitor to usenull
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 instanceprotected RefactoringContext createRefactoringContext(RefactoringDescriptor descriptor, RefactoringStatus status, IProgressMonitor monitor) throws CoreException
A caller of this method must ensure that RefactoringContext.dispose()
is eventually called.
The default implementation delegates the task to the refactoring descriptor.
descriptor
- the refactoring descriptorstatus
- a refactoring status to describe the outcome of the initializationmonitor
- the progress monitor to usenull
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 contextpublic 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.
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.