mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: cleanup - simplify
This commit is contained in:
+16
-21
@@ -377,12 +377,9 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
|
||||
JPanel mainPanel;
|
||||
if (optionsPanel != null) {
|
||||
JScrollPane optionsPane = ScrollPaneFactory.createScrollPane(optionsPanel, true);
|
||||
JPanel infoPanel = JBUI.Panels.simplePanel(optionsPane).withBorder(JBUI.Borders.emptyLeft(10));
|
||||
|
||||
mainPanel = new JPanel(new MyOptionsLayout(mySplitter, infoPanel, JBUI.scale(150), JBUI.scale(400)));
|
||||
mainPanel = new JPanel(new MyOptionsLayout(mySplitter, optionsPanel, JBUI.scale(150), JBUI.scale(400)));
|
||||
mainPanel.add(mySplitter);
|
||||
mainPanel.add(infoPanel);
|
||||
mainPanel.add(optionsPanel);
|
||||
}
|
||||
else {
|
||||
mainPanel = mySplitter;
|
||||
@@ -456,7 +453,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
|
||||
@Nullable
|
||||
private JPanel createOptionsPanel(@NotNull Project project, @NotNull String borderTitleName) {
|
||||
Box optionsBox = Box.createVerticalBox();
|
||||
boolean hasVcsOptions = false;
|
||||
Box vcsCommitOptions = Box.createVerticalBox();
|
||||
for (AbstractVcs vcs : ContainerUtil.sorted(getAffectedVcses(), VCS_COMPARATOR)) {
|
||||
@@ -478,11 +474,6 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
}
|
||||
}
|
||||
|
||||
if (hasVcsOptions) {
|
||||
vcsCommitOptions.add(Box.createVerticalGlue());
|
||||
optionsBox.add(vcsCommitOptions);
|
||||
}
|
||||
|
||||
boolean beforeVisible = false;
|
||||
boolean afterVisible = false;
|
||||
Box beforeBox = Box.createVerticalBox();
|
||||
@@ -507,6 +498,14 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasVcsOptions && !beforeVisible && !afterVisible) return null;
|
||||
|
||||
Box optionsBox = Box.createVerticalBox();
|
||||
if (hasVcsOptions) {
|
||||
vcsCommitOptions.add(Box.createVerticalGlue());
|
||||
optionsBox.add(vcsCommitOptions);
|
||||
}
|
||||
|
||||
if (beforeVisible) {
|
||||
beforeBox.add(Box.createVerticalGlue());
|
||||
JPanel beforePanel = new JPanel(new BorderLayout());
|
||||
@@ -525,16 +524,12 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj
|
||||
optionsBox.add(afterPanel);
|
||||
}
|
||||
|
||||
JPanel optionsPanel;
|
||||
if (hasVcsOptions || beforeVisible || afterVisible) {
|
||||
optionsBox.add(Box.createVerticalGlue());
|
||||
optionsPanel = new JPanel(new BorderLayout());
|
||||
optionsPanel.add(optionsBox, BorderLayout.NORTH);
|
||||
}
|
||||
else {
|
||||
optionsPanel = null;
|
||||
}
|
||||
return optionsPanel;
|
||||
optionsBox.add(Box.createVerticalGlue());
|
||||
JPanel additionalOptionsPanel = new JPanel(new BorderLayout());
|
||||
additionalOptionsPanel.add(optionsBox, BorderLayout.NORTH);
|
||||
|
||||
JScrollPane optionsPane = ScrollPaneFactory.createScrollPane(additionalOptionsPanel, true);
|
||||
return JBUI.Panels.simplePanel(optionsPane).withBorder(JBUI.Borders.emptyLeft(10));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user