diff --git a/platform/lang-impl/src/com/intellij/ide/actions/ReloadFromDiskAction.java b/platform/lang-impl/src/com/intellij/ide/actions/ReloadFromDiskAction.java deleted file mode 100644 index dfe3b5a2eac2..000000000000 --- a/platform/lang-impl/src/com/intellij/ide/actions/ReloadFromDiskAction.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -package com.intellij.ide.actions; - -import com.intellij.ide.IdeBundle; -import com.intellij.openapi.actionSystem.AnAction; -import com.intellij.openapi.actionSystem.AnActionEvent; -import com.intellij.openapi.actionSystem.CommonDataKeys; -import com.intellij.openapi.application.ApplicationManager; -import com.intellij.openapi.command.CommandProcessor; -import com.intellij.openapi.editor.Editor; -import com.intellij.openapi.project.DumbAware; -import com.intellij.openapi.project.Project; -import com.intellij.openapi.ui.Messages; -import com.intellij.psi.PsiDocumentManager; -import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiManager; -import org.jetbrains.annotations.NotNull; - -public class ReloadFromDiskAction extends AnAction implements DumbAware { - @Override - public void actionPerformed(@NotNull AnActionEvent e) { - final Project project = e.getProject(); - final Editor editor = e.getData(CommonDataKeys.EDITOR); - if (project == null || editor == null) return; - final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); - if (file == null) return; - - String message = IdeBundle.message("prompt.reload.file.from.disk", file.getVirtualFile().getPresentableUrl()); - int res = Messages.showOkCancelDialog(project, message, IdeBundle.message("title.reload.file"), Messages.getWarningIcon()); - if (res != Messages.OK) return; - - Runnable command = () -> ApplicationManager.getApplication().runWriteAction( - () -> { - if (!project.isDisposed()) { - file.getVirtualFile().refresh(false, false); - PsiManager.getInstance(project).reloadFromDisk(file); - } - } - ); - CommandProcessor.getInstance().executeCommand(project, command, IdeBundle.message("command.reload.from.disk"), null); - } - - @Override - public void update(@NotNull AnActionEvent event) { - boolean enabled = false; - - Project project = event.getProject(); - Editor editor = event.getData(CommonDataKeys.EDITOR); - if (project != null && editor != null) { - PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); - if (file != null && file.getVirtualFile() != null) { - enabled = true; - } - } - - event.getPresentation().setEnabled(enabled); - } -} diff --git a/platform/platform-resources-en/src/messages/ActionsBundle.properties b/platform/platform-resources-en/src/messages/ActionsBundle.properties index ac1f03b1d698..56a2f2732431 100644 --- a/platform/platform-resources-en/src/messages/ActionsBundle.properties +++ b/platform/platform-resources-en/src/messages/ActionsBundle.properties @@ -313,7 +313,7 @@ action.ImportFromEclipse.text=Import From Eclipse... action.ImportFromEclipse.description=Create project from Eclipse projects action.ExportToEclipse.text=Export To Eclipse... action.ExportToEclipse.description=Create Eclipse projects for each module -action.Synchronize.text=S_ynchronize +action.Synchronize.text=Reload All from Disk action.Synchronize.description=Detect all externally changed files and reload them from disk action.ReloadFromDisk.text=Reload from Dis_k action.ReloadFromDisk.description=Reload current file from disk and lose all changes @@ -1178,7 +1178,7 @@ action.AssociateWithFileType.text=Associate with File Type... action.AssociateWithFileType.description=Associate selected file with one of file types action.RestoreDefaultExtensionScripts.text=Restore Default Extensions action.RestoreDefaultExtensionScripts.description=Restore bundled extensions for this directory -action.SynchronizeCurrentFile.text=Synchronize selected file +action.SynchronizeCurrentFile.text=Reload from Disk action.TypeHierarchy.BaseOnThisType.text=Base On This Type action.TypeHierarchy.Class.text=Class Hierarchy action.TypeHierarchy.Subtypes.text=Subtypes Hierarchy diff --git a/platform/platform-resources/src/idea/LangActions.xml b/platform/platform-resources/src/idea/LangActions.xml index 587b699c109f..97f7a0bffb32 100644 --- a/platform/platform-resources/src/idea/LangActions.xml +++ b/platform/platform-resources/src/idea/LangActions.xml @@ -75,12 +75,6 @@ - - - - diff --git a/platform/vcs-impl/src/com/intellij/ide/actions/SynchronizeCurrentFileAction.java b/platform/vcs-impl/src/com/intellij/ide/actions/SynchronizeCurrentFileAction.java index fffe6f059c40..53c8cf4ef4f6 100644 --- a/platform/vcs-impl/src/com/intellij/ide/actions/SynchronizeCurrentFileAction.java +++ b/platform/vcs-impl/src/com/intellij/ide/actions/SynchronizeCurrentFileAction.java @@ -43,7 +43,6 @@ public class SynchronizeCurrentFileAction extends AnAction implements DumbAware } else { e.getPresentation().setEnabledAndVisible(true); - e.getPresentation().setText(getMessage(project, files)); } }