mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
rename file: move to java/groovy
This commit is contained in:
+5
-3
@@ -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) {
|
||||
@@ -254,7 +254,6 @@
|
||||
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"/>
|
||||
@@ -572,9 +571,6 @@
|
||||
<separator/>
|
||||
<reference ref="AddToFavorites"/>
|
||||
<reference ref="AddAllToFavorites"/>
|
||||
<separator/>
|
||||
<reference ref="RenameFile"/>
|
||||
<separator/>
|
||||
<reference ref="MoveToChangeList"/>
|
||||
<separator/>
|
||||
<reference ref="RunContextPopupGroup"/>
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
<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"/>
|
||||
|
||||
Reference in New Issue
Block a user