public class MoveHandler extends java.lang.Object implements RefactoringActionHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
REFACTORING_NAME
Deprecated.
Use
getRefactoringName() instead |
Constructor and Description |
---|
MoveHandler() |
Modifier and Type | Method and Description |
---|---|
static PsiElement [] |
adjustForMove(Project project,
PsiElement[] sourceElements,
PsiElement targetElement)
Performs some extra checks (that canMove does not)
May replace some elements with others which actually shall be moved (e.g.
|
static boolean |
canMove(DataContext dataContext) |
static boolean |
canMove(PsiElement [] elements,
PsiElement targetContainer)
Must be invoked in AtomicAction
target container can be null => means that container is not determined yet and must be spacify by the user
|
static void |
doMove(Project project,
PsiElement [] elements,
PsiElement targetContainer,
DataContext dataContext,
MoveCallback callback)
must be invoked in AtomicAction
|
static java.lang.String |
getActionName(DataContext dataContext) |
static java.lang.String |
getRefactoringName() |
void |
invoke(Project project,
Editor editor,
PsiFile file,
DataContext dataContext)
called by an Action in AtomicAction when refactoring is invoked from Editor
|
void |
invoke(Project project,
PsiElement [] elements,
DataContext dataContext)
called by an Action in AtomicAction
|
static boolean |
isMoveRedundant(PsiElement source,
PsiElement target) |
static boolean |
isValidTarget(PsiElement psiElement,
PsiElement[] elements) |
@Deprecated public static final java.lang.String REFACTORING_NAME
getRefactoringName()
insteadpublic void invoke(Project project, Editor editor, PsiFile file, DataContext dataContext)
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)
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 void doMove(Project project, PsiElement [] elements, PsiElement targetContainer, DataContext dataContext, MoveCallback callback)
public static PsiElement [] adjustForMove(Project project, PsiElement[] sourceElements, PsiElement targetElement)
public static boolean canMove(PsiElement [] elements, PsiElement targetContainer)
public static java.lang.String getActionName(DataContext dataContext)
public static boolean isValidTarget(PsiElement psiElement, PsiElement[] elements)
public static boolean canMove(DataContext dataContext)
public static boolean isMoveRedundant(PsiElement source, PsiElement target)
public static java.lang.String getRefactoringName()