public class MethodDuplicatesHandler extends java.lang.Object implements RefactoringActionHandler, ContextAwareActionHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REFACTORING_NAME
Deprecated.
Use
getRefactoringName() instead |
Constructor and Description |
---|
MethodDuplicatesHandler() |
Modifier and Type | Method and Description |
---|---|
static DuplicatesFinder |
createDuplicatesFinder(PsiMember member) |
static java.lang.String |
getRefactoringName() |
static java.util.List<Match> |
hasDuplicates(PsiElement file,
PsiMember member) |
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 |
invokeOnScope(Project project,
PsiMember member,
AnalysisScope scope) |
static void |
invokeOnScope(Project project,
java.util.Set<? extends PsiMember> members,
AnalysisScope scope,
boolean silent) |
boolean |
isAvailableForQuickList(Editor editor,
PsiFile file,
DataContext dataContext)
Handlers could provide useful hints when they are actually not available, e.g.
|
static void |
replaceDuplicate(Project project,
java.util.Map<PsiMember,java.util.List<Match>> duplicates,
java.util.Set<? extends PsiMember> methods) |
@Deprecated public static final java.lang.String REFACTORING_NAME
getRefactoringName()
insteadpublic boolean isAvailableForQuickList(Editor editor, PsiFile file, DataContext dataContext)
ContextAwareActionHandler
isAvailableForQuickList
in interface ContextAwareActionHandler
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 static void invokeOnScope(Project project, PsiMember member, AnalysisScope scope)
public static void invokeOnScope(Project project, java.util.Set<? extends PsiMember> members, AnalysisScope scope, boolean silent)
public static void replaceDuplicate(Project project, java.util.Map<PsiMember,java.util.List<Match>> duplicates, java.util.Set<? extends PsiMember> methods)
public static java.util.List<Match> hasDuplicates(PsiElement file, PsiMember member)
public static DuplicatesFinder createDuplicatesFinder(PsiMember member)
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
)public static java.lang.String getRefactoringName()