Search in sources :

Example 1 with JavaRefactoringFactory

use of com.intellij.refactoring.JavaRefactoringFactory in project intellij-plugins by JetBrains.

the class ActivatorRenameTest method renamePackage.

private void renamePackage() {
    VirtualFile sourceRoot = ModuleRootManager.getInstance(myModule).getSourceRoots()[0];
    JavaRefactoringFactory factory = JavaRefactoringFactory.getInstance(getProject());
    MoveDestination moveDestination = factory.createSourceRootMoveDestination("tx", sourceRoot);
    factory.createMoveClassesOrPackages(new PsiElement[] { myActivator }, moveDestination).run();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) JavaRefactoringFactory(com.intellij.refactoring.JavaRefactoringFactory) MoveDestination(com.intellij.refactoring.MoveDestination) PsiElement(com.intellij.psi.PsiElement)

Aggregations

VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiElement (com.intellij.psi.PsiElement)1 JavaRefactoringFactory (com.intellij.refactoring.JavaRefactoringFactory)1 MoveDestination (com.intellij.refactoring.MoveDestination)1