mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
do not show some Go to actions in non-text editors
GitOrigin-RevId: 46e9f43810036c99d030cfa17ea5b8587fc3cfef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e5f742376b
commit
a45d9516d6
@@ -84,6 +84,7 @@ public abstract class CodeInsightAction extends AnAction implements UpdateInBack
|
||||
final DataContext dataContext = e.getDataContext();
|
||||
Editor editor = getEditor(dataContext, project, true);
|
||||
if (editor == null) {
|
||||
presentation.setVisible(!ActionPlaces.isPopupPlace(e.getPlace()));
|
||||
presentation.setEnabled(false);
|
||||
return;
|
||||
}
|
||||
|
||||
+5
-1
@@ -30,7 +30,11 @@ public abstract class PresentableActionHandlerBasedAction extends BaseCodeInsigh
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent event) {
|
||||
// since previous handled may have changed the presentation, we need to restore it; otherwise it will stick.
|
||||
if (!getLanguageExtension().hasAnyExtensions()) {
|
||||
event.getPresentation().setEnabledAndVisible(false);
|
||||
return;
|
||||
}
|
||||
// since previous handled may have changed the presentation, we need to restore it; otherwise it will stick.
|
||||
event.getPresentation().copyFrom(getTemplatePresentation());
|
||||
applyTextOverride(event);
|
||||
super.update(event);
|
||||
|
||||
-12
@@ -21,7 +21,6 @@ import com.intellij.codeInsight.generation.actions.PresentableActionHandlerBased
|
||||
import com.intellij.lang.CodeInsightActions;
|
||||
import com.intellij.lang.Language;
|
||||
import com.intellij.lang.LanguageExtension;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
@@ -57,17 +56,6 @@ public class GotoSuperAction extends PresentableActionHandlerBasedAction impleme
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull final AnActionEvent event) {
|
||||
if (CodeInsightActions.GOTO_SUPER.hasAnyExtensions()) {
|
||||
event.getPresentation().setVisible(true);
|
||||
super.update(event);
|
||||
}
|
||||
else {
|
||||
event.getPresentation().setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected LanguageExtension<CodeInsightActionHandler> getLanguageExtension() {
|
||||
|
||||
Reference in New Issue
Block a user