public abstract class BaseRefactoringProcessor
extends java.lang.Object
implements java.lang.Runnable
Modifier and Type | Class and Description |
---|---|
static class |
BaseRefactoringProcessor.ConflictsInTestsException |
static class |
BaseRefactoringProcessor.UnknownReferenceTypeException |
Modifier and Type | Field and Description |
---|---|
protected java.lang.Runnable |
myPrepareSuccessfulSwingThreadCallback |
protected Project |
myProject |
protected SearchScope |
myRefactoringScope |
Modifier | Constructor and Description |
---|---|
protected |
BaseRefactoringProcessor(Project project) |
protected |
BaseRefactoringProcessor(Project project,
java.lang.Runnable prepareSuccessfulCallback) |
protected |
BaseRefactoringProcessor(Project project,
SearchScope refactoringScope,
java.lang.Runnable prepareSuccessfulCallback) |
Modifier and Type | Method and Description |
---|---|
protected ConflictsDialog |
createConflictsDialog(MultiMap<PsiElement,java.lang.String> conflicts,
UsageInfo [] usages) |
protected abstract UsageViewDescriptor |
createUsageViewDescriptor(UsageInfo [] usages) |
protected void |
customizeUsagesView(UsageViewDescriptor viewDescriptor,
UsageView usageView) |
protected void |
doRun() |
protected void |
execute(UsageInfo [] usages) |
protected abstract UsageInfo [] |
findUsages()
Is called inside atomic action.
|
protected RefactoringEventData |
getAfterData(UsageInfo [] usages) |
protected RefactoringEventData |
getBeforeData() |
protected abstract java.lang.String |
getCommandName() |
protected java.util.Collection<? extends PsiElement> |
getElementsToWrite(UsageViewDescriptor descriptor) |
protected java.lang.String |
getRefactoringId() |
protected RefactoringTransaction |
getTransaction() |
protected UndoConfirmationPolicy |
getUndoConfirmationPolicy() |
protected boolean |
isGlobalUndoAction() |
protected boolean |
isPreviewUsages() |
protected boolean |
isPreviewUsages(UsageInfo [] usages)
Is called inside atomic action.
|
protected boolean |
isToBeChanged(UsageInfo usageInfo) |
protected void |
performPsiSpoilingRefactoring()
Refactorings that spoil PSI (write something directly to documents etc.) should
do that in this method.
This method is called immediately after . |
protected abstract void |
performRefactoring(UsageInfo [] usages)
Is called in a command and inside atomic action.
|
protected ConflictsDialog |
prepareConflictsDialog(MultiMap<PsiElement,java.lang.String> conflicts,
UsageInfo [] usages) |
protected void |
prepareSuccessful() |
protected boolean |
preprocessUsages(Ref<UsageInfo[]> refUsages)
Is called inside atomic action.
|
protected void |
previewRefactoring(UsageInfo [] usages) |
static boolean |
processConflicts(Project project,
MultiMap<PsiElement,java.lang.String> conflicts)
Processes conflicts (possibly shows UI).
|
protected void |
refreshElements(PsiElement [] elements)
is called when usage search is re-run.
|
void |
run() |
static <T extends java.lang.Throwable> |
runWithDisabledPreview(ThrowableRunnable<T> runnable) |
void |
setPrepareSuccessfulSwingThreadCallback(java.lang.Runnable prepareSuccessfulSwingThreadCallback) |
void |
setPreviewUsages(boolean isPreviewUsages) |
protected boolean |
shouldDisableAccessChecks() |
protected boolean |
showConflicts(MultiMap<PsiElement,java.lang.String> conflicts)
Deprecated.
|
protected boolean |
showConflicts(MultiMap<PsiElement,java.lang.String> conflicts,
UsageInfo [] usages) |
protected boolean |
skipNonCodeUsages() |
protected final Project myProject
protected final SearchScope myRefactoringScope
protected java.lang.Runnable myPrepareSuccessfulSwingThreadCallback
protected BaseRefactoringProcessor(Project project)
protected BaseRefactoringProcessor(Project project, java.lang.Runnable prepareSuccessfulCallback)
protected BaseRefactoringProcessor(Project project, SearchScope refactoringScope, java.lang.Runnable prepareSuccessfulCallback)
protected abstract UsageViewDescriptor createUsageViewDescriptor(UsageInfo [] usages)
protected abstract UsageInfo [] findUsages()
protected void refreshElements(PsiElement [] elements)
elements
- - refreshed elements that are returned by UsageViewDescriptor.getElements()protected boolean preprocessUsages(Ref<UsageInfo[]> refUsages)
refUsages
- usages to be filteredprotected boolean isPreviewUsages(UsageInfo [] usages)
protected boolean isPreviewUsages()
public void setPreviewUsages(boolean isPreviewUsages)
public void setPrepareSuccessfulSwingThreadCallback(java.lang.Runnable prepareSuccessfulSwingThreadCallback)
protected RefactoringTransaction getTransaction()
protected abstract void performRefactoring(UsageInfo [] usages)
protected abstract java.lang.String getCommandName()
protected void doRun()
public static <T extends java.lang.Throwable> void runWithDisabledPreview(ThrowableRunnable<T> runnable) throws T extends java.lang.Throwable
T extends java.lang.Throwable
protected void previewRefactoring(UsageInfo [] usages)
protected boolean skipNonCodeUsages()
protected void execute(UsageInfo [] usages)
protected boolean isGlobalUndoAction()
protected UndoConfirmationPolicy getUndoConfirmationPolicy()
public static boolean processConflicts(Project project, MultiMap<PsiElement,java.lang.String> conflicts)
BaseRefactoringProcessor.ConflictsInTestsException
that can be handled inside a test.
Thrown exception would contain conflicts' messages.project
- projectconflicts
- map with conflict messages and locationsprotected void customizeUsagesView(UsageViewDescriptor viewDescriptor, UsageView usageView)
protected boolean isToBeChanged(UsageInfo usageInfo)
protected void performPsiSpoilingRefactoring()
performRefactoring(UsageInfo[])
.protected void prepareSuccessful()
public final void run()
run
in interface java.lang.Runnable
protected boolean shouldDisableAccessChecks()
@Deprecated protected boolean showConflicts(MultiMap<PsiElement,java.lang.String> conflicts)
showConflicts(MultiMap, UsageInfo[])
protected boolean showConflicts(MultiMap<PsiElement,java.lang.String> conflicts, UsageInfo [] usages)
protected ConflictsDialog prepareConflictsDialog(MultiMap<PsiElement,java.lang.String> conflicts, UsageInfo [] usages)
protected RefactoringEventData getBeforeData()
protected RefactoringEventData getAfterData(UsageInfo [] usages)
protected java.lang.String getRefactoringId()
protected ConflictsDialog createConflictsDialog(MultiMap<PsiElement,java.lang.String> conflicts, UsageInfo [] usages)
protected java.util.Collection<? extends PsiElement> getElementsToWrite(UsageViewDescriptor descriptor)