public abstract class RenamePsiElementProcessor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static RenamePsiElementProcessor |
DEFAULT |
static ExtensionPointName<RenamePsiElementProcessor> |
EP_NAME |
Constructor and Description |
---|
RenamePsiElementProcessor() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<RenamePsiElementProcessor> |
allForElement(PsiElement element) |
abstract boolean |
canProcessElement(PsiElement element) |
RenameDialog |
createRenameDialog(Project project,
PsiElement element,
PsiElement nameSuggestionContext,
Editor editor) |
UsageInfo |
createUsageInfo(PsiElement element,
PsiReference ref,
PsiElement referenceElement) |
void |
findCollisions(PsiElement element,
java.lang.String newName,
java.util.Map<? extends PsiElement,java.lang.String> allRenames,
java.util.List<UsageInfo> result) |
void |
findExistingNameConflicts(PsiElement element,
java.lang.String newName,
MultiMap<PsiElement,java.lang.String> conflicts) |
void |
findExistingNameConflicts(PsiElement element,
java.lang.String newName,
MultiMap<PsiElement,java.lang.String> conflicts,
java.util.Map<PsiElement,java.lang.String> allRenames) |
java.util.Collection<PsiReference> |
findReferences(PsiElement element)
Deprecated.
use
findReferences(PsiElement, SearchScope, boolean) instead |
java.util.Collection<PsiReference> |
findReferences(PsiElement element,
boolean searchInCommentsAndStrings)
Deprecated.
use
findReferences(PsiElement, SearchScope, boolean) instead |
java.util.Collection<PsiReference> |
findReferences(PsiElement element,
SearchScope searchScope,
boolean searchInCommentsAndStrings) |
boolean |
forcesShowPreview()
Use this method to force showing preview for custom processors.
|
static RenamePsiElementProcessor |
forElement(PsiElement element) |
PsiElement |
getElementToSearchInStringsAndComments(PsiElement element) |
java.lang.String |
getHelpID(PsiElement element) |
java.lang.Runnable |
getPostRenameCallback(PsiElement element,
java.lang.String newName,
RefactoringElementListener elementListener) |
java.lang.String |
getQualifiedNameAfterRename(PsiElement element,
java.lang.String newName,
boolean nonJava) |
Pair<java.lang.String,java.lang.String> |
getTextOccurrenceSearchStrings(PsiElement element,
java.lang.String newName) |
boolean |
isInplaceRenameSupported() |
boolean |
isToSearchForTextOccurrences(PsiElement element) |
boolean |
isToSearchInComments(PsiElement element) |
void |
prepareRenaming(PsiElement element,
java.lang.String newName,
java.util.Map<PsiElement,java.lang.String> allRenames)
Builds the complete set of elements to be renamed during the refactoring.
|
void |
prepareRenaming(PsiElement element,
java.lang.String newName,
java.util.Map<PsiElement,java.lang.String> allRenames,
SearchScope scope) |
void |
renameElement(PsiElement element,
java.lang.String newName,
UsageInfo [] usages,
RefactoringElementListener listener) |
void |
setToSearchForTextOccurrences(PsiElement element,
boolean enabled) |
void |
setToSearchInComments(PsiElement element,
boolean enabled) |
boolean |
showRenamePreviewButton(PsiElement psiElement) |
PsiElement |
substituteElementToRename(PsiElement element,
Editor editor)
Returns the element to be renamed instead of the element on which the rename refactoring was invoked (for example, a super method
of an inherited method).
|
void |
substituteElementToRename(PsiElement element,
Editor editor,
Pass<PsiElement> renameCallback)
Substitutes element to be renamed and initiate rename procedure.
|
public static final ExtensionPointName<RenamePsiElementProcessor> EP_NAME
public static final RenamePsiElementProcessor DEFAULT
public abstract boolean canProcessElement(PsiElement element)
public RenameDialog createRenameDialog(Project project, PsiElement element, PsiElement nameSuggestionContext, Editor editor)
public void renameElement(PsiElement element, java.lang.String newName, UsageInfo [] usages, RefactoringElementListener listener) throws IncorrectOperationException
IncorrectOperationException
@Deprecated public java.util.Collection<PsiReference> findReferences(PsiElement element, boolean searchInCommentsAndStrings)
findReferences(PsiElement, SearchScope, boolean)
instead@Deprecated public java.util.Collection<PsiReference> findReferences(PsiElement element)
findReferences(PsiElement, SearchScope, boolean)
insteadpublic java.util.Collection<PsiReference> findReferences(PsiElement element, SearchScope searchScope, boolean searchInCommentsAndStrings)
public Pair<java.lang.String,java.lang.String> getTextOccurrenceSearchStrings(PsiElement element, java.lang.String newName)
public java.lang.String getQualifiedNameAfterRename(PsiElement element, java.lang.String newName, boolean nonJava)
public void prepareRenaming(PsiElement element, java.lang.String newName, java.util.Map<PsiElement,java.lang.String> allRenames)
element
- the base element for the refactoring.newName
- the name into which the element is being renamed.allRenames
- the map (from element to its new name) into which all additional elements to be renamed should be stored.public void prepareRenaming(PsiElement element, java.lang.String newName, java.util.Map<PsiElement,java.lang.String> allRenames, SearchScope scope)
public void findExistingNameConflicts(PsiElement element, java.lang.String newName, MultiMap<PsiElement,java.lang.String> conflicts)
public void findExistingNameConflicts(PsiElement element, java.lang.String newName, MultiMap<PsiElement,java.lang.String> conflicts, java.util.Map<PsiElement,java.lang.String> allRenames)
public boolean isInplaceRenameSupported()
public static java.util.List<RenamePsiElementProcessor> allForElement(PsiElement element)
public static RenamePsiElementProcessor forElement(PsiElement element)
public java.lang.Runnable getPostRenameCallback(PsiElement element, java.lang.String newName, RefactoringElementListener elementListener)
public java.lang.String getHelpID(PsiElement element)
public boolean isToSearchInComments(PsiElement element)
public void setToSearchInComments(PsiElement element, boolean enabled)
public boolean isToSearchForTextOccurrences(PsiElement element)
public void setToSearchForTextOccurrences(PsiElement element, boolean enabled)
public boolean showRenamePreviewButton(PsiElement psiElement)
public PsiElement substituteElementToRename(PsiElement element, Editor editor)
element
- the element on which the refactoring was invoked.editor
- the editor in which the refactoring was invoked.public void substituteElementToRename(PsiElement element, Editor editor, Pass<PsiElement> renameCallback)
element
- the element on which refactoring was invokededitor
- the editor in which inplace refactoring was invokedrenameCallback
- rename procedure which should be called on the chosen substitutionpublic void findCollisions(PsiElement element, java.lang.String newName, java.util.Map<? extends PsiElement,java.lang.String> allRenames, java.util.List<UsageInfo> result)
public boolean forcesShowPreview()
public PsiElement getElementToSearchInStringsAndComments(PsiElement element)
public UsageInfo createUsageInfo(PsiElement element, PsiReference ref, PsiElement referenceElement)