mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-242936 [new run config UI] when switching to the new UI before launch tasks, non-empty logs and coverage sections are closed by default
before run fragment fixed GitOrigin-RevId: b348dc8dd7973606abf69e2bc47593440a827071
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f033166f02
commit
76cc5b0ba9
+2
-1
@@ -1,6 +1,7 @@
|
||||
// Copyright 2000-2020 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.execution.application;
|
||||
|
||||
import com.intellij.compiler.options.CompileStepBeforeRun;
|
||||
import com.intellij.diagnostic.logging.LogsFragment;
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.execution.JavaRunConfigurationExtensionManager;
|
||||
@@ -31,7 +32,7 @@ public class JavaApplicationSettingsEditor extends RunConfigurationFragmentedEdi
|
||||
protected List<SettingsEditorFragment<ApplicationConfiguration, ?>> createRunFragments() {
|
||||
List<SettingsEditorFragment<ApplicationConfiguration, ?>> fragments = new ArrayList<>();
|
||||
BeforeRunComponent beforeRunComponent = new BeforeRunComponent();
|
||||
fragments.add(BeforeRunFragment.createComponent(beforeRunComponent));
|
||||
fragments.add(BeforeRunFragment.createBeforeRun(beforeRunComponent, CompileStepBeforeRun.ID));
|
||||
fragments.addAll(BeforeRunFragment.createGroup());
|
||||
|
||||
ModuleClasspathCombo.Item item = new ModuleClasspathCombo.Item(ExecutionBundle.message("application.configuration.include.provided.scope"));
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.execution.configurations.RunConfigurationBase;
|
||||
import com.intellij.execution.impl.RunnerAndConfigurationSettingsImpl;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.JBUI;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -15,6 +17,8 @@ import java.util.List;
|
||||
|
||||
public final class BeforeRunFragment<S extends RunConfigurationBase<?>> extends RunConfigurationEditorFragment<S, JComponent> {
|
||||
private final BeforeRunComponent myComponent;
|
||||
private final Key<?> myKey;
|
||||
private RunnerAndConfigurationSettingsImpl mySettings;
|
||||
|
||||
public static <S extends RunConfigurationBase<?>> List<SettingsEditorFragment<S, ?>> createGroup() {
|
||||
ArrayList<SettingsEditorFragment<S, ?>> list = new ArrayList<>();
|
||||
@@ -31,18 +35,25 @@ public final class BeforeRunFragment<S extends RunConfigurationBase<?>> extends
|
||||
return list;
|
||||
}
|
||||
|
||||
public static <S extends RunConfigurationBase<?>> BeforeRunFragment<S> createComponent(BeforeRunComponent component) {
|
||||
return new BeforeRunFragment<>(component);
|
||||
public static <S extends RunConfigurationBase<?>> BeforeRunFragment<S> createBeforeRun(BeforeRunComponent component,
|
||||
Key<?> key) {
|
||||
return new BeforeRunFragment<>(component, key);
|
||||
}
|
||||
|
||||
private BeforeRunFragment(BeforeRunComponent component) {
|
||||
private BeforeRunFragment(BeforeRunComponent component, Key<?> key) {
|
||||
super("beforeRunTasks", ExecutionBundle.message("run.configuration.before.run.task"),
|
||||
ExecutionBundle.message("run.configuration.before.run.group"), wrap(component), -2);
|
||||
myComponent = component;
|
||||
myKey = key;
|
||||
component.myChangeListener = () -> fireEditorStateChanged();
|
||||
Disposer.register(this, component);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInitiallyVisible(S s) {
|
||||
return ContainerUtil.exists(mySettings.getManager().getBeforeRunTasks(s), task -> task.getProviderId() != myKey);
|
||||
}
|
||||
|
||||
private static JComponent wrap(BeforeRunComponent component) {
|
||||
JPanel panel = new JPanel(new BorderLayout());
|
||||
JPanel labelPanel = new JPanel(new BorderLayout());
|
||||
@@ -69,7 +80,8 @@ public final class BeforeRunFragment<S extends RunConfigurationBase<?>> extends
|
||||
|
||||
@Override
|
||||
public void resetEditorFrom(@NotNull RunnerAndConfigurationSettingsImpl s) {
|
||||
myComponent.reset(s);
|
||||
mySettings = s;
|
||||
myComponent.reset(mySettings);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+3
-3
@@ -25,9 +25,9 @@ public abstract class RunConfigurationEditorFragment<Settings, C extends JCompon
|
||||
public abstract void applyEditorTo(@NotNull RunnerAndConfigurationSettingsImpl s);
|
||||
|
||||
public static <Settings> SettingsEditorFragment<Settings, ?> createSettingsTag(String id, String name, String group,
|
||||
Predicate<RunnerAndConfigurationSettingsImpl> getter,
|
||||
BiConsumer<RunnerAndConfigurationSettingsImpl, Boolean> setter,
|
||||
int menuPosition) {
|
||||
Predicate<RunnerAndConfigurationSettingsImpl> getter,
|
||||
BiConsumer<RunnerAndConfigurationSettingsImpl, Boolean> setter,
|
||||
int menuPosition) {
|
||||
Ref<SettingsEditorFragment<?, ?>> ref = new Ref<>();
|
||||
TagButton button = new TagButton(name, () -> ref.get().setSelected(false));
|
||||
RunConfigurationEditorFragment<Settings, ?> fragment = new RunConfigurationEditorFragment<Settings, JComponent>(id, name, group, button, 0) {
|
||||
|
||||
+2
-2
@@ -25,14 +25,14 @@ public class RunnerAndConfigurationSettingsEditor extends SettingsEditor<RunnerA
|
||||
|
||||
@Override
|
||||
protected void resetEditorFrom(@NotNull RunnerAndConfigurationSettings s) {
|
||||
myConfigurationEditor.resetFrom((RunConfigurationBase<?>)s.getConfiguration());
|
||||
myConfigurationEditor.resetEditorFrom((RunnerAndConfigurationSettingsImpl)s);
|
||||
myConfigurationEditor.resetFrom((RunConfigurationBase<?>)s.getConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void applyEditorTo(@NotNull RunnerAndConfigurationSettings s) throws ConfigurationException {
|
||||
myConfigurationEditor.applyTo((RunConfigurationBase<?>)s.getConfiguration());
|
||||
myConfigurationEditor.applyEditorTo((RunnerAndConfigurationSettingsImpl)s);
|
||||
myConfigurationEditor.applyTo((RunConfigurationBase<?>)s.getConfiguration());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user