use of com.intellij.refactoring.rename.RenameProcessor in project intellij-community by JetBrains.
the class SrcRepositoryUseTest method renamePackage.
private void renamePackage(String packageName, String newPackageName) throws Exception {
PsiPackage aPackage = JavaPsiFacade.getInstance(myPsiManager.getProject()).findPackage(packageName);
assertNotNull("Package " + packageName + " not found", aPackage);
//PsiDirectory dir = aPackage.getDirectories()[0];
//to rename dir with classes move is used
new RenameProcessor(myProject, aPackage, newPackageName, true, true).run();
FileDocumentManager.getInstance().saveAllDocuments();
}
use of com.intellij.refactoring.rename.RenameProcessor in project intellij-community by JetBrains.
the class DaemonRespondToChangesTest method testRenameClass.
public void testRenameClass() throws Exception {
configureByFile(BASE_PATH + "AClass.java");
Document document = getDocument(getFile());
Collection<HighlightInfo> infos = highlightErrors();
assertEquals(0, infos.size());
final PsiClass psiClass = ((PsiJavaFile) getFile()).getClasses()[0];
new RenameProcessor(myProject, psiClass, "Class2", false, false).run();
TextRange dirty = myDaemonCodeAnalyzer.getFileStatusMap().getFileDirtyScope(document, Pass.UPDATE_ALL);
assertEquals(getFile().getTextRange(), dirty);
highlightErrors();
assertTrue(myDaemonCodeAnalyzer.isErrorAnalyzingFinished(getFile()));
}
use of com.intellij.refactoring.rename.RenameProcessor in project intellij-community by JetBrains.
the class RefactoringFieldTest method performRename.
protected void performRename(String newName) {
PsiElement element = TargetElementUtil.findTargetElement(myFixture.getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
new RenameProcessor(getProject(), element, newName, false, false).run();
}
use of com.intellij.refactoring.rename.RenameProcessor in project intellij-community by JetBrains.
the class AbstractJavaFXRenameTest method doRenameWithAutomaticRenamers.
protected void doRenameWithAutomaticRenamers(PsiElement elementAtCaret, String newName) {
final RenameProcessor processor = new RenameProcessor(getProject(), elementAtCaret, newName, false, false);
for (AutomaticRenamerFactory factory : Extensions.getExtensions(AutomaticRenamerFactory.EP_NAME)) {
processor.addRenamerFactory(factory);
}
processor.run();
}
use of com.intellij.refactoring.rename.RenameProcessor in project intellij-community by JetBrains.
the class JavaFXRenameTest method testIdWithRefs.
public void testIdWithRefs() throws Exception {
myFixture.configureByFiles(getTestName(true) + ".fxml");
PsiElement element = TargetElementUtil.findTargetElement(getEditor(), TargetElementUtil.ELEMENT_NAME_ACCEPTED | TargetElementUtil.REFERENCED_ELEMENT_ACCEPTED);
assertNotNull(element);
new RenameProcessor(getProject(), element, "lb1", true, true).run();
myFixture.checkResultByFile(getTestName(true) + "_after.fxml");
}
Aggregations