From d4cef5f54d306bdcf6be1d62db035e1699bb80be Mon Sep 17 00:00:00 2001 From: "andrey.zaytsev" Date: Thu, 12 Apr 2012 17:36:25 +0400 Subject: [PATCH] Breakpoint Editor: alignment --- .../BreakpointPropertiesPanel.form | 10 ++++----- .../BreakpointPropertiesPanel.java | 9 +++++++- .../com/intellij/util/IJSwingUtilities.java | 22 ++++++++++++++----- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form index 8af7bb90b418..bb003768594e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.form @@ -246,7 +246,7 @@ - + @@ -260,7 +260,7 @@ - + @@ -305,7 +305,7 @@ - + @@ -350,7 +350,7 @@ - + @@ -396,7 +396,7 @@ - + diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java index a894cb2d9a2a..cb03df288379 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointPropertiesPanel.java @@ -43,6 +43,7 @@ import com.intellij.psi.PsiElement; import com.intellij.ui.FieldPanel; import com.intellij.ui.MultiLineTooltipUI; import com.intellij.ui.components.JBCheckBox; +import com.intellij.util.IJSwingUtilities; import com.intellij.xdebugger.impl.ui.DebuggerUIUtil; import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; @@ -207,9 +208,11 @@ public abstract class BreakpointPropertiesPanel { } }); + mySuspendAllRadio.addItemListener(suspendPolicyChangeListener); mySuspendThreadRadio.addItemListener(suspendPolicyChangeListener); - + + myMakeDefaultButton.addActionListener(new ActionListener() { public void actionPerformed(final ActionEvent e) { final BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager(); @@ -314,6 +317,10 @@ public abstract class BreakpointPropertiesPanel { DebuggerUIUtil.focusEditorOnCheck(myLogExpressionCheckBox, myLogExpressionCombo); DebuggerUIUtil.focusEditorOnCheck(myInstanceFiltersCheckBox, myInstanceFiltersField.getTextField()); DebuggerUIUtil.focusEditorOnCheck(myClassFiltersCheckBox, myClassFiltersField.getTextField()); + + IJSwingUtilities.adjustComponentsOnMac(mySuspendJBCheckBox); + IJSwingUtilities.adjustComponentsOnMac(myLogExpressionCheckBox); + IJSwingUtilities.adjustComponentsOnMac(myLogMessageCheckBox); } private String getSelectedSuspendPolicy() { diff --git a/platform/platform-impl/src/com/intellij/util/IJSwingUtilities.java b/platform/platform-impl/src/com/intellij/util/IJSwingUtilities.java index f1ecf7e68a18..fadbcf72dd44 100644 --- a/platform/platform-impl/src/com/intellij/util/IJSwingUtilities.java +++ b/platform/platform-impl/src/com/intellij/util/IJSwingUtilities.java @@ -26,8 +26,6 @@ import gnu.trove.TIntStack; import org.jetbrains.annotations.Nullable; import javax.swing.*; -import javax.swing.border.CompoundBorder; -import javax.swing.border.EmptyBorder; import java.awt.*; import java.util.Iterator; @@ -179,16 +177,28 @@ public class IJSwingUtilities { return (T)ContainerUtil.find(getParents(focusOwner), (FilteringIterator.InstanceOf)FilteringIterator.instanceOf(aClass)); } - public static void adjustComponentsOnMac(JLabel label, JComponent component) { - if (label == null || component == null) return; + public static void adjustComponentsOnMac(@Nullable JComponent component) { + adjustComponentsOnMac(null, component); + } + + + public static void adjustComponentsOnMac(@Nullable JLabel label, @Nullable JComponent component) { + if (component == null) return; if (!UIUtil.isUnderAquaLookAndFeel()) return; if (component instanceof JComboBox) { UIUtil.addInsets(component, new Insets(0,-2,0,0)); - UIUtil.addInsets(label, new Insets(0,2,0,0)); + if (label != null) { + UIUtil.addInsets(label, new Insets(0,2,0,0)); + } + } + if (component instanceof JCheckBox) { + UIUtil.addInsets(component, new Insets(0,-5,0,0)); } if (component instanceof JTextField || component instanceof EditorTextField) { - UIUtil.addInsets(label, new Insets(0,3,0,0)); + if (label != null) { + UIUtil.addInsets(label, new Insets(0,3,0,0)); + } } } } \ No newline at end of file