public abstract class AbstractRefactoring extends Object
RefactoringSession
Modifier and Type | Field and Description |
---|---|
static int |
INIT
Initial state
|
static int |
PARAMETERS_CHECK
Parameters check state.
|
static int |
PRE_CHECK
Pre-check state.
|
static int |
PREPARE
Prepare state.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractRefactoring(Lookup refactoringSource) |
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(ProgressListener listener)
Registers ProgressListener to receive events.
|
void |
cancelRequest()
Asynchronous request to cancel ongoing long-term request (such as preCheck(), checkParameters() or prepare())
|
Problem |
checkParameters()
Checks if this refactoring has correctly set all parameters.
|
Problem |
fastCheckParameters()
This method checks parameters.
|
Context |
getContext()
getter for refactoring Context
|
Lookup |
getRefactoringSource()
Object being refactored
|
Problem |
preCheck()
Perform checks to ensure that the preconditions are met for the implemented
refactoring.
|
Problem |
prepare(RefactoringSession session)
Collects and returns a set of refactoring elements - objects that
will be affected by the refactoring.
|
void |
removeProgressListener(ProgressListener listener)
Removes ProgressListener from the list of listeners.
|
public static final int INIT
public static final int PRE_CHECK
public static final int PARAMETERS_CHECK
public static final int PREPARE
protected AbstractRefactoring(Lookup refactoringSource)
@CheckForNull public final Problem preCheck()
null
if no problems
were found.@CheckForNull public final Problem prepare(@NonNull RefactoringSession session)
session
- RefactoringSession that the operation will use to return
instances of RefactoringElement
class representing objects that
will be affected by the refactoring.null
in no problems
were found.@CheckForNull public final Problem checkParameters()
@CheckForNull public final Problem fastCheckParameters()
public final void addProgressListener(@NonNull ProgressListener listener)
listener
- The listener to register.public final void removeProgressListener(@NonNull ProgressListener listener)
listener
- The listener to remove.@NonNull public final Context getContext()
Context
@NonNull public final Lookup getRefactoringSource()
public final void cancelRequest()