* 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
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) {
class = "com.intellij.refactoring.actions.RefactoringQuickListPopupAction"
text = "Refactor This..." description="Context aware popup with list of refactoring actions"/>
<action id="RenameElement" class="com.intellij.refactoring.actions.RenameElementAction"/>
- <action id="RenameFile" class="com.intellij.refactoring.rename.RenameFileAction"/>
<action id="ChangeSignature" class="com.intellij.refactoring.actions.ChangeSignatureAction"/>
<separator/>
<action id="Move" class="com.intellij.refactoring.actions.MoveAction"/>
<separator/>
<reference ref="AddToFavorites"/>
<reference ref="AddAllToFavorites"/>
- <separator/>
- <reference ref="RenameFile"/>
- <separator/>
<reference ref="MoveToChangeList"/>
<separator/>
<reference ref="RunContextPopupGroup"/>
<add-to-group group-id="IntroduceActionsGroup" anchor="after" relative-to-action="IntroduceParameter"/>
</action>
+ <action id="RenameFile" class="com.intellij.refactoring.actions.RenameFileAction">
+ <add-to-group group-id="RefactoringMenu" anchor="after" relative-to-action="RenameElement"/>
+ <add-to-group group-id="EditorTabPopupMenuEx" anchor="after" relative-to-action="AddAllToFavorites"/>
+ </action>
+
<group id="RefactoringMenu4">
<action id="TurnRefsToSuper" class="com.intellij.refactoring.actions.TurnRefsToSuperAction"/>
<action id="InheritanceToDelegation" class="com.intellij.refactoring.actions.InheritanceToDelegationAction"/>