use of com.intellij.refactoring.move.MoveHandlerDelegate in project intellij-community by JetBrains.
the class MoveInnerToUpperOrMembersHandler method doMove.
public void doMove(final Project project, final PsiElement[] elements, final PsiElement targetContainer, final MoveCallback callback) {
SelectInnerOrMembersRefactoringDialog dialog = new SelectInnerOrMembersRefactoringDialog((PsiClass) elements[0], project);
if (!dialog.showAndGet()) {
return;
}
MoveHandlerDelegate delegate = dialog.getRefactoringHandler();
if (delegate != null) {
delegate.doMove(project, elements, targetContainer, callback);
}
}
use of com.intellij.refactoring.move.MoveHandlerDelegate in project intellij-community by JetBrains.
the class MoveInnerToUpperOrMembersHandler method tryToMove.
public boolean tryToMove(final PsiElement element, final Project project, final DataContext dataContext, final PsiReference reference, final Editor editor) {
if (isStaticInnerClass(element) && !JavaMoveClassesOrPackagesHandler.isReferenceInAnonymousClass(reference)) {
FeatureUsageTracker.getInstance().triggerFeatureUsed("refactoring.move.moveInner");
final PsiElement targetContainer = LangDataKeys.TARGET_PSI_ELEMENT.getData(dataContext);
PsiClass aClass = (PsiClass) element;
SelectInnerOrMembersRefactoringDialog dialog = new SelectInnerOrMembersRefactoringDialog(aClass, project);
if (dialog.showAndGet()) {
final MoveHandlerDelegate moveHandlerDelegate = dialog.getRefactoringHandler();
if (moveHandlerDelegate != null) {
moveHandlerDelegate.doMove(project, new PsiElement[] { aClass }, targetContainer, null);
}
}
return true;
}
return false;
}
Aggregations