mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Follow-up on IJP-1167 'Run Current File' feature: disable it if Run Widget is active (they don't look great together)
GitOrigin-RevId: 29675a972fe47e8f161daf974f9dab27f6c5cb92
This commit is contained in:
committed by
intellij-monorepo-bot
parent
850655067b
commit
da36c15a00
@@ -1,10 +1,7 @@
|
||||
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.execution;
|
||||
|
||||
import com.intellij.execution.actions.ConfigurationContext;
|
||||
import com.intellij.execution.actions.ConfigurationFromContext;
|
||||
import com.intellij.execution.actions.RunContextAction;
|
||||
import com.intellij.execution.actions.RunNewConfigurationContextAction;
|
||||
import com.intellij.execution.actions.*;
|
||||
import com.intellij.execution.compound.CompoundRunConfiguration;
|
||||
import com.intellij.execution.compound.SettingsAndEffectiveTarget;
|
||||
import com.intellij.execution.configurations.RunConfiguration;
|
||||
@@ -329,7 +326,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry {
|
||||
text = myExecutor.getStartActionText(configuration.getName());
|
||||
}
|
||||
else {
|
||||
if (Registry.is("run.current.file.item.in.run.configurations.combobox")) {
|
||||
if (RunConfigurationsComboBoxAction.hasRunCurrentFileItem(project)) {
|
||||
Pair<Boolean, String> enabledStatusAndText = getEnabledStatusAndTextForRunCurrentFileAction(e);
|
||||
enabled = enabledStatusAndText.first;
|
||||
//noinspection HardCodedStringLiteral
|
||||
@@ -475,7 +472,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry {
|
||||
if (selectedConfiguration != null) {
|
||||
run(project, selectedConfiguration.getConfiguration(), selectedConfiguration, e.getDataContext());
|
||||
}
|
||||
else if (Registry.is("run.current.file.item.in.run.configurations.combobox")) {
|
||||
else if (RunConfigurationsComboBoxAction.hasRunCurrentFileItem(project)) {
|
||||
runCurrentFile(e);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -43,6 +43,10 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
public static final Icon CHECKED_SELECTED_ICON = JBUIScale.scaleIcon(new SizedIcon(AllIcons.Actions.Checked_selected, 16, 16));
|
||||
public static final Icon EMPTY_ICON = EmptyIcon.ICON_16;
|
||||
|
||||
public static boolean hasRunCurrentFileItem(@NotNull Project project) {
|
||||
return !RunManager.getInstance(project).isRunWidgetActive() && Registry.is("run.current.file.item.in.run.configurations.combobox");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
Presentation presentation = e.getPresentation();
|
||||
@@ -96,7 +100,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (Registry.is("run.current.file.item.in.run.configurations.combobox")) {
|
||||
if (project != null && hasRunCurrentFileItem(project)) {
|
||||
presentation.setText(ExecutionBundle.messagePointer("run.configurations.combo.run.current.file.selected"));
|
||||
presentation.setIcon(null);
|
||||
return;
|
||||
@@ -325,8 +329,7 @@ public class RunConfigurationsComboBoxAction extends ComboBoxAction implements D
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
e.getPresentation().setEnabledAndVisible(e.getProject() != null &&
|
||||
Registry.is("run.current.file.item.in.run.configurations.combobox"));
|
||||
e.getPresentation().setEnabledAndVisible(e.getProject() != null && hasRunCurrentFileItem(e.getProject()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user