IDEA-236390 Implement new UI for editing run configuration settings

subgroups moved to the bottom

GitOrigin-RevId: f2a87ab4efc20e25b5b646dd9fb9cfbafd4f3664
This commit is contained in:
Dmitry Avdeev
2020-05-29 13:19:26 +03:00
committed by intellij-monorepo-bot
parent 21681eb694
commit 19dd38caa1
3 changed files with 13 additions and 9 deletions
@@ -73,12 +73,9 @@ public class JavaApplicationSettingsEditor extends RunConfigurationFragmentedEdi
ShortenCommandLineModeCombo combo =
new ShortenCommandLineModeCombo(myProject, jrePathEditor, moduleClasspath.component().getComponent());
LabeledComponent<ShortenCommandLineModeCombo> component =
LabeledComponent.create(combo, ExecutionBundle.message("application.configuration.shorten.command.line.label"));
component.setLabelLocation(BorderLayout.WEST);
fragments.add(new SettingsEditorFragment<>("shorten.command.line",
ExecutionBundle.message("application.configuration.shorten.command.line"),
group, component,
group, LabeledComponent.create(combo, ExecutionBundle.message("application.configuration.shorten.command.line.label"), BorderLayout.WEST),
(configuration, c) -> c.getComponent().setItem(configuration.getShortenCommandLine()),
(configuration, c) -> configuration.setShortenCommandLine(c.getComponent().getSelectedItem()),
configuration -> configuration.getShortenCommandLine() != null));
@@ -10,8 +10,8 @@ public class CommonTags {
return SettingsEditorFragment.createTag("runParallel",
ExecutionBundle.message("run.configuration.allow.running.parallel"),
ExecutionBundle.message("group.operating.system"),
s -> s.isAllowRunningInParallel(),
(s, aBoolean) -> s.setAllowRunningInParallel(aBoolean)
s -> s.isAllowRunningInParallel(),
(s, value) -> s.setAllowRunningInParallel(value)
);
}
}
@@ -50,6 +50,8 @@ public class FragmentedSettingsBuilder<Settings> implements CompositeSettingsBui
addLine(new JSeparator());
}
List<SettingsEditorFragment<Settings, ?>> fragments = new ArrayList<>(myFragments);
List<SettingsEditorFragment<Settings, ?>> subGroups = ContainerUtil.filter(fragments, fragment -> !fragment.getChildren().isEmpty());
fragments.removeAll(subGroups);
fragments.sort(Comparator.comparingInt(SettingsEditorFragment::getCommandLinePosition));
buildBeforeRun(fragments);
addLine(buildHeader(fragments));
@@ -59,7 +61,6 @@ public class FragmentedSettingsBuilder<Settings> implements CompositeSettingsBui
addLine(buildCommandLinePanel(fragments));
JPanel tagsPanel = new JPanel(new WrapLayout(FlowLayout.LEADING));
tagsPanel.setBorder(JBUI.Borders.empty(5, -5, 5, 0));
for (SettingsEditorFragment<Settings, ?> fragment : fragments) {
if (fragment.isTag()) {
tagsPanel.add(fragment.getComponent());
@@ -69,8 +70,14 @@ public class FragmentedSettingsBuilder<Settings> implements CompositeSettingsBui
}
}
addLine(tagsPanel);
myConstraints.weighty = 1;
myPanel.add(new JPanel(), myConstraints);
for (SettingsEditorFragment<Settings, ?> group : subGroups) {
addLine(group.getComponent());
}
if (myMain == null) {
myConstraints.weighty = 1;
myPanel.add(new JPanel(), myConstraints);
}
List<PanelWithAnchor> panels =
fragments.stream().map(SettingsEditorFragment::component).filter(component -> component instanceof PanelWithAnchor)