public class RenameProcessor extends BaseRefactoringProcessor
BaseRefactoringProcessor.ConflictsInTestsException, BaseRefactoringProcessor.UnknownReferenceTypeException
Modifier and Type | Field and Description |
---|---|
protected java.util.LinkedHashMap<PsiElement,java.lang.String> |
myAllRenames |
protected boolean |
myForceShowPreview |
myPrepareSuccessfulSwingThreadCallback, myProject, myRefactoringScope
Constructor and Description |
---|
RenameProcessor(Project project,
PsiElement element,
java.lang.String newName,
boolean isSearchInComments,
boolean isSearchTextOccurrences) |
RenameProcessor(Project project,
PsiElement element,
java.lang.String newName,
SearchScope refactoringScope,
boolean isSearchInComments,
boolean isSearchTextOccurrences) |
Modifier and Type | Method and Description |
---|---|
void |
addElement(PsiElement element,
java.lang.String newName) |
void |
addRenamerFactory(AutomaticRenamerFactory factory) |
static void |
assertNonCompileElement(PsiElement element) |
static MultiMap<PsiElement,UsageInfo> |
classifyUsages(java.util.Collection<? extends PsiElement> elements,
UsageInfo[] usages) |
protected UsageViewDescriptor |
createUsageViewDescriptor(UsageInfo [] usages) |
void |
doRun() |
UsageInfo [] |
findUsages()
Is called inside atomic action.
|
protected RefactoringEventData |
getAfterData(UsageInfo [] usages) |
protected RefactoringEventData |
getBeforeData() |
protected java.lang.String |
getCommandName() |
java.util.Set<PsiElement> |
getElements() |
java.lang.String |
getNewName(PsiElement element) |
java.util.Collection<java.lang.String> |
getNewNames() |
protected java.lang.String |
getRefactoringId() |
boolean |
hasNonCodeUsages() |
protected boolean |
isPreviewUsages(UsageInfo [] usages)
Is called inside atomic action.
|
boolean |
isSearchInComments() |
boolean |
isSearchTextOccurrences() |
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 . |
void |
performRefactoring(UsageInfo [] usages)
Is called in a command and inside atomic action.
|
void |
prepareRenaming(PsiElement element,
java.lang.String newName,
java.util.LinkedHashMap<PsiElement,java.lang.String> allRenames) |
boolean |
preprocessUsages(Ref<UsageInfo[]> refUsages)
Is called inside atomic action.
|
protected void |
refreshElements(PsiElement [] elements)
is called when usage search is re-run.
|
void |
removeRenamerFactory(AutomaticRenamerFactory factory) |
void |
setCommandName(java.lang.String commandName) |
void |
setSearchInComments(boolean value) |
void |
setSearchTextOccurrences(boolean searchTextOccurrences) |
protected boolean |
showAutomaticRenamingDialog(AutomaticRenamer automaticVariableRenamer) |
createConflictsDialog, customizeUsagesView, execute, getElementsToWrite, getTransaction, getUndoConfirmationPolicy, isGlobalUndoAction, isPreviewUsages, isToBeChanged, prepareConflictsDialog, prepareSuccessful, previewRefactoring, processConflicts, run, runWithDisabledPreview, setPrepareSuccessfulSwingThreadCallback, setPreviewUsages, shouldDisableAccessChecks, showConflicts, showConflicts, skipNonCodeUsages
protected final java.util.LinkedHashMap<PsiElement,java.lang.String> myAllRenames
protected boolean myForceShowPreview
public RenameProcessor(Project project, PsiElement element, java.lang.String newName, boolean isSearchInComments, boolean isSearchTextOccurrences)
public RenameProcessor(Project project, PsiElement element, java.lang.String newName, SearchScope refactoringScope, boolean isSearchInComments, boolean isSearchTextOccurrences)
public java.util.Set<PsiElement> getElements()
public java.lang.String getNewName(PsiElement element)
public void addRenamerFactory(AutomaticRenamerFactory factory)
public void removeRenamerFactory(AutomaticRenamerFactory factory)
public void doRun()
doRun
in class BaseRefactoringProcessor
public void prepareRenaming(PsiElement element, java.lang.String newName, java.util.LinkedHashMap<PsiElement,java.lang.String> allRenames)
public boolean preprocessUsages(Ref<UsageInfo[]> refUsages)
BaseRefactoringProcessor
preprocessUsages
in class BaseRefactoringProcessor
refUsages
- usages to be filteredpublic static void assertNonCompileElement(PsiElement element)
protected boolean showAutomaticRenamingDialog(AutomaticRenamer automaticVariableRenamer)
public void addElement(PsiElement element, java.lang.String newName)
protected UsageViewDescriptor createUsageViewDescriptor(UsageInfo [] usages)
createUsageViewDescriptor
in class BaseRefactoringProcessor
public UsageInfo [] findUsages()
BaseRefactoringProcessor
findUsages
in class BaseRefactoringProcessor
public boolean hasNonCodeUsages()
protected void refreshElements(PsiElement [] elements)
BaseRefactoringProcessor
refreshElements
in class BaseRefactoringProcessor
elements
- - refreshed elements that are returned by UsageViewDescriptor.getElements()protected boolean isPreviewUsages(UsageInfo [] usages)
BaseRefactoringProcessor
isPreviewUsages
in class BaseRefactoringProcessor
protected java.lang.String getRefactoringId()
getRefactoringId
in class BaseRefactoringProcessor
protected RefactoringEventData getBeforeData()
getBeforeData
in class BaseRefactoringProcessor
protected RefactoringEventData getAfterData(UsageInfo [] usages)
getAfterData
in class BaseRefactoringProcessor
public void performRefactoring(UsageInfo [] usages)
BaseRefactoringProcessor
performRefactoring
in class BaseRefactoringProcessor
protected void performPsiSpoilingRefactoring()
BaseRefactoringProcessor
BaseRefactoringProcessor.performRefactoring(UsageInfo[])
.performPsiSpoilingRefactoring
in class BaseRefactoringProcessor
protected java.lang.String getCommandName()
getCommandName
in class BaseRefactoringProcessor
public static MultiMap<PsiElement,UsageInfo> classifyUsages(java.util.Collection<? extends PsiElement> elements, UsageInfo[] usages)
public java.util.Collection<java.lang.String> getNewNames()
public void setSearchInComments(boolean value)
public void setSearchTextOccurrences(boolean searchTextOccurrences)
public boolean isSearchInComments()
public boolean isSearchTextOccurrences()
public void setCommandName(java.lang.String commandName)