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)
Executes this runnable.
|
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 use@Deprecated protected 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 instance@Deprecated protected 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
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
monitor
- 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 fails
Copyright (c) 2000, 2016 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.