diff --git a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameFileAction.java b/java/java-impl/src/com/intellij/refactoring/actions/RenameFileAction.java similarity index 82% rename from platform/lang-impl/src/com/intellij/refactoring/rename/RenameFileAction.java rename to java/java-impl/src/com/intellij/refactoring/actions/RenameFileAction.java index a0aa127ec7b1..1e0008cb867d 100644 --- a/platform/lang-impl/src/com/intellij/refactoring/rename/RenameFileAction.java +++ b/java/java-impl/src/com/intellij/refactoring/actions/RenameFileAction.java @@ -13,13 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package com.intellij.refactoring.rename; +package com.intellij.refactoring.actions; import com.intellij.openapi.actionSystem.*; import com.intellij.openapi.project.DumbAware; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; +import com.intellij.psi.PsiClassOwner; import com.intellij.psi.PsiFile; +import com.intellij.refactoring.rename.PsiElementRenameHandler; /** * @author ven @@ -34,13 +36,13 @@ public class RenameFileAction extends AnAction implements DumbAware { assert virtualFile != null; final Project project = e.getData(PlatformDataKeys.PROJECT); assert project != null; - new RenameDialog(project, file, file, null).show(); + PsiElementRenameHandler.invoke(file, project, file, null); } public void update(AnActionEvent e) { PsiFile file = e.getData(LangDataKeys.PSI_FILE); Presentation presentation = e.getPresentation(); - boolean enabled = file != null && e.getPlace() != ActionPlaces.EDITOR_POPUP && e.getData(PlatformDataKeys.PROJECT) != null; + boolean enabled = file instanceof PsiClassOwner && e.getPlace() != ActionPlaces.EDITOR_POPUP && e.getData(PlatformDataKeys.PROJECT) != null; presentation.setEnabled(enabled); presentation.setVisible(enabled); if (enabled) { diff --git a/platform/platform-resources/src/idea/LangActions.xml b/platform/platform-resources/src/idea/LangActions.xml index 4e5cd27f0bfd..55c7d4b531c0 100644 --- a/platform/platform-resources/src/idea/LangActions.xml +++ b/platform/platform-resources/src/idea/LangActions.xml @@ -254,7 +254,6 @@ class = "com.intellij.refactoring.actions.RefactoringQuickListPopupAction" text = "Refactor This..." description="Context aware popup with list of refactoring actions"/> - @@ -572,9 +571,6 @@ - - - diff --git a/resources/src/idea/JavaActions.xml b/resources/src/idea/JavaActions.xml index 9ba1550421ee..675fcf4d2022 100644 --- a/resources/src/idea/JavaActions.xml +++ b/resources/src/idea/JavaActions.xml @@ -73,6 +73,11 @@ + + + + +