use of com.intellij.refactoring.safeDelete.SafeDeleteHandler in project android by JetBrains.
the class AndroidSafeDeleteTest method testDeleteComponent.
public void testDeleteComponent() {
myFixture.copyFileToProject(TEST_FOLDER + "f1.xml", "AndroidManifest.xml");
final VirtualFile activityFile = myFixture.copyFileToProject(TEST_FOLDER + "MyActivity.java", "src/p1/p2/MyActivity.java");
myFixture.configureFromExistingVirtualFile(activityFile);
final PsiFile psiActivityFile = PsiManager.getInstance(getProject()).findFile(activityFile);
final PsiClass activityClass = ((PsiJavaFile) psiActivityFile).getClasses()[0];
final DataContext context = DataManager.getInstance().getDataContext(myFixture.getEditor().getComponent());
new SafeDeleteHandler().invoke(getProject(), new PsiElement[] { activityClass }, context);
myFixture.checkResultByFile("AndroidManifest.xml", TEST_FOLDER + "f1_after.xml", true);
}
Aggregations