mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
terminal: no "Open in Terminal" action for Light Edit (there is no Terminal tool window)
GitOrigin-RevId: c796eb27034467f149247a84f8d6fef0c5a44b0b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8a8c3cf942
commit
31e3bdfe89
+8
-3
@@ -2,6 +2,7 @@
|
||||
package org.jetbrains.plugins.terminal.action;
|
||||
|
||||
import com.intellij.ide.actions.RevealFileAction;
|
||||
import com.intellij.ide.lightEdit.LightEditUtil;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.CommonDataKeys;
|
||||
import com.intellij.openapi.project.DumbAwareAction;
|
||||
@@ -17,8 +18,12 @@ import org.jetbrains.plugins.terminal.TerminalView;
|
||||
public class RevealFileInTerminalAction extends DumbAwareAction {
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Project project = getEventProject(e);
|
||||
e.getPresentation().setEnabledAndVisible(project != null && getSelectedFile(e) != null);
|
||||
e.getPresentation().setEnabledAndVisible(isAvailable(e));
|
||||
}
|
||||
|
||||
private static boolean isAvailable(@NotNull AnActionEvent e) {
|
||||
Project project = e.getProject();
|
||||
return project != null && !LightEditUtil.isLightEditProject(project) && getSelectedFile(e) != null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -28,7 +33,7 @@ public class RevealFileInTerminalAction extends DumbAwareAction {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
Project project = getEventProject(e);
|
||||
Project project = e.getProject();
|
||||
VirtualFile selectedFile = getSelectedFile(e);
|
||||
if (project == null || selectedFile == null) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user