From b98c669390545321b28d93217bfb464b86572f44 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Fri, 12 Jul 2019 21:53:14 +0200 Subject: [PATCH] SSR: border for replace template editor GitOrigin-RevId: ab10e71ac9ae4dd8e579ffebd4fcd1e2959d5bf9 --- .../plugin/ui/StructuralSearchDialog.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchDialog.java b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchDialog.java index effd2e098db0..eba1a52bb4b0 100644 --- a/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchDialog.java +++ b/platform/structuralsearch/source/com/intellij/structuralsearch/plugin/ui/StructuralSearchDialog.java @@ -380,7 +380,6 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana mySearchEditorPanel.setLackOfSpaceStrategy(Splitter.LackOfSpaceStrategy.HONOR_THE_SECOND_MIN_SIZE); mySearchCriteriaEdit = createEditor(); mySearchEditorPanel.setFirstComponent(mySearchCriteriaEdit); - mySearchEditorPanel.add(BorderLayout.CENTER, mySearchCriteriaEdit); final JPanel wrapper = new JPanel(new BorderLayout()); final Color color = UIManager.getColor("Borders.ContrastBorderColor"); @@ -449,10 +448,17 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana myShortenFQN = new JCheckBox(SSRBundle.message("shorten.fully.qualified.names.checkbox")); myReformat = new JCheckBox(SSRBundle.message("reformat.checkbox")); myUseStaticImport = new JCheckBox(SSRBundle.message("use.static.import.checkbox")); - myReplaceCriteriaEdit = createEditor(); + myReplaceEditorPanel = new OnePixelSplitter(false, 1.0f); + myReplaceEditorPanel.setLackOfSpaceStrategy(Splitter.LackOfSpaceStrategy.HONOR_THE_SECOND_MIN_SIZE); + myReplaceCriteriaEdit = createEditor(); myReplaceEditorPanel.setFirstComponent(myReplaceCriteriaEdit); + final JPanel wrapper = new JPanel(new BorderLayout()); + final Color color = UIManager.getColor("Borders.ContrastBorderColor"); + wrapper.setBorder(IdeBorderFactory.createBorder(color)); + wrapper.add(myReplaceEditorPanel, BorderLayout.CENTER); + final JPanel replacePanel = new JPanel(null); final GroupLayout layout = new GroupLayout(replacePanel); replacePanel.setLayout(layout); @@ -469,7 +475,7 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED, 15, 15) .addComponent(myUseStaticImport) ) - .addComponent(myReplaceEditorPanel) + .addComponent(wrapper) ); layout.setVerticalGroup( layout.createSequentialGroup(). @@ -480,7 +486,7 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana .addComponent(myReformat) .addComponent(myUseStaticImport) ) - .addComponent(myReplaceEditorPanel) + .addComponent(wrapper) ); return replacePanel; @@ -1180,7 +1186,7 @@ public class StructuralSearchDialog extends DialogWrapper implements ProjectMana @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { - EditorTextField editorTextField = ComponentUtil.getParentOfType((Class)EditorTextField.class, c); + final EditorTextField editorTextField = ComponentUtil.getParentOfType((Class)EditorTextField.class, c); if (editorTextField == null) { return; }