public class PsiElementRenameHandler extends java.lang.Object implements RenameHandler
Modifier and Type | Field and Description |
---|---|
static DataKey<java.lang.String> |
DEFAULT_NAME |
EP_NAME
Constructor and Description |
---|
PsiElementRenameHandler() |
Modifier and Type | Method and Description |
---|---|
static boolean |
canRename(Project project,
Editor editor,
PsiElement element) |
static PsiElement |
getElement(DataContext dataContext) |
void |
invoke(Project project,
Editor editor,
PsiFile file,
DataContext dataContext)
Invokes refactoring action from editor.
|
void |
invoke(Project project,
PsiElement [] elements,
DataContext dataContext)
Invokes refactoring action from elsewhere (not from editor).
|
static void |
invoke(PsiElement element,
Project project,
PsiElement nameSuggestionContext,
Editor editor) |
static void |
invoke(PsiElement element,
Project project,
PsiElement nameSuggestionContext,
Editor editor,
boolean checkInProject) |
boolean |
isAvailableOnDataContext(DataContext dataContext) |
static boolean |
isVetoed(PsiElement element) |
static void |
rename(PsiElement element,
Project project,
PsiElement nameSuggestionContext,
Editor editor) |
static void |
rename(PsiElement element,
Project project,
PsiElement nameSuggestionContext,
Editor editor,
java.lang.String defaultName) |
static void |
rename(PsiElement element,
Project project,
PsiElement nameSuggestionContext,
Editor editor,
java.lang.String defaultName,
RenamePsiElementProcessor processor) |
protected boolean |
shouldCheckInProject() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isRenaming
public static final DataKey<java.lang.String> DEFAULT_NAME
public void invoke(Project project, Editor editor, PsiFile file, DataContext dataContext)
RefactoringActionHandler
invoke
in interface RefactoringActionHandler
project
- the project in which the refactoring is invoked.editor
- editor that refactoring is invoked infile
- file should correspond to editor
dataContext
- can be null
for some but not all of refactoring action handlers
(it is recommended to pass DataManager.getDataContext()
instead of null
)public void invoke(Project project, PsiElement [] elements, DataContext dataContext)
RefactoringActionHandler
invoke
in interface RefactoringActionHandler
project
- the project in which the refactoring is invoked.elements
- list of elements that refactoring should work on. Refactoring-dependent.dataContext
- can be null
for some but not all of refactoring action handlers
(it is recommended to pass DataManager.getDataContext()
instead of null
)protected boolean shouldCheckInProject()
public static void invoke(PsiElement element, Project project, PsiElement nameSuggestionContext, Editor editor)
public static void invoke(PsiElement element, Project project, PsiElement nameSuggestionContext, Editor editor, boolean checkInProject)
public static boolean canRename(Project project, Editor editor, PsiElement element) throws CommonRefactoringUtil.RefactoringErrorHintException
public static void rename(PsiElement element, Project project, PsiElement nameSuggestionContext, Editor editor)
public static void rename(PsiElement element, Project project, PsiElement nameSuggestionContext, Editor editor, java.lang.String defaultName)
public static void rename(PsiElement element, Project project, PsiElement nameSuggestionContext, Editor editor, java.lang.String defaultName, RenamePsiElementProcessor processor)
public boolean isAvailableOnDataContext(DataContext dataContext)
isAvailableOnDataContext
in interface RenameHandler
public static boolean isVetoed(PsiElement element)
public static PsiElement getElement(DataContext dataContext)