Search in sources :

Example 1 with ResourceBundleRenamerFactory

use of com.intellij.lang.properties.refactoring.rename.ResourceBundleRenamerFactory in project intellij-community by JetBrains.

the class ResourceBundleTest method doTestRenameResourceBundleEntryFile.

private void doTestRenameResourceBundleEntryFile(String fileNameToRenameBefore, String fileNameToCheckBefore, String fileNameToRenameAfter, String fileNameToCheckAfter) {
    final PsiFile toRenameFile = myFixture.addFileToProject(fileNameToRenameBefore, "");
    final PsiFile toCheck = myFixture.addFileToProject(fileNameToCheckBefore, "");
    final RenameProcessor processor = new RenameProcessor(getProject(), toRenameFile, fileNameToRenameAfter, true, true);
    for (AutomaticRenamerFactory factory : Extensions.getExtensions(AutomaticRenamerFactory.EP_NAME)) {
        if (factory instanceof ResourceBundleRenamerFactory) {
            processor.addRenamerFactory(factory);
        }
    }
    processor.run();
    assertEquals(fileNameToCheckAfter, toCheck.getName());
}
Also used : AutomaticRenamerFactory(com.intellij.refactoring.rename.naming.AutomaticRenamerFactory) RenameProcessor(com.intellij.refactoring.rename.RenameProcessor) ResourceBundleRenamerFactory(com.intellij.lang.properties.refactoring.rename.ResourceBundleRenamerFactory) PsiFile(com.intellij.psi.PsiFile)

Aggregations

ResourceBundleRenamerFactory (com.intellij.lang.properties.refactoring.rename.ResourceBundleRenamerFactory)1 PsiFile (com.intellij.psi.PsiFile)1 RenameProcessor (com.intellij.refactoring.rename.RenameProcessor)1 AutomaticRenamerFactory (com.intellij.refactoring.rename.naming.AutomaticRenamerFactory)1