diff options
Diffstat (limited to 'platform/platform-api/src/com/intellij/openapi/ui')
5 files changed, 26 insertions, 21 deletions
diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java index 9e6c0aa1b965..5d2ecafb1b7e 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/ComboBoxTableRenderer.java @@ -76,6 +76,10 @@ public class ComboBoxTableRenderer<T> extends JLabel implements TableCellRendere return value.toString(); } + protected Icon getIconFor(@NotNull T value) { + return null; + } + protected Runnable onChosen(@NotNull final T value) { stopCellEditing(value); @@ -137,6 +141,11 @@ public class ComboBoxTableRenderer<T> extends JLabel implements TableCellRendere return ComboBoxTableRenderer.this.getTextFor(value); } + @Override + public Icon getIconFor(T value) { + return ComboBoxTableRenderer.this.getIconFor(value); + } + public PopupStep onChosen(T selectedValue, boolean finalChoice) { myFinalRunnable = ComboBoxTableRenderer.this.onChosen(selectedValue); return FINAL_CHOICE; @@ -169,6 +178,9 @@ public class ComboBoxTableRenderer<T> extends JLabel implements TableCellRendere protected void customizeComponent(final T value, final JTable table, final boolean isSelected) { setOpaque(true); setText(value == null ? "" : getTextFor(value)); + if (value != null) { + setIcon(getIconFor(value)); + } setBackground(isSelected ? table.getSelectionBackground() : table.getBackground()); setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); } diff --git a/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java b/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java index 5bbd3d12da6a..34aaa93d2741 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/DetailsComponent.java @@ -170,11 +170,7 @@ public class DetailsComponent { myContent.setBorder(new EmptyBorder(UIUtil.PANEL_REGULAR_INSETS)); } else { - if (Registry.is("ide.new.project.settings")) { - myContent.setBorder(new EmptyBorder(16, 10, 16, 10)); - } else { - myContent.setBorder(null); - } + myContent.setBorder(null); } } diff --git a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java index 6f38d9a96356..101444a9d649 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/FixedSizeButton.java @@ -87,7 +87,7 @@ public class FixedSizeButton extends JButton { public Dimension getPreferredSize() { if (myComponent != null) { int size = myComponent.getPreferredSize().height; - if (myComponent instanceof ComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) { + if (myComponent instanceof JComboBox && (UIUtil.isUnderIntelliJLaF() || UIUtil.isUnderDarcula())) { size -= 2; // decrement to match JTextField's preferred height } return new Dimension(size, size); @@ -120,9 +120,7 @@ public class FixedSizeButton extends JButton { public void setBounds(Rectangle r) { if (r.width != r.height) { int size = Math.min(r.width, r.height); - r = new Rectangle(r); - r.width = size; - r.height = size; + r = new Rectangle(r.x, r.y, size, size); } super.setBounds(r); } diff --git a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java index 35e81b032ba5..816349ed1c37 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/MasterDetailsComponent.java @@ -135,11 +135,7 @@ public abstract class MasterDetailsComponent implements Configurable, DetailsCom mySplitter.setSplitterProportionKey("ProjectStructure.SecondLevelElements"); mySplitter.setHonorComponentsMinimumSize(true); if (Registry.is("ide.new.project.settings")) { - mySplitter.setDividerWidth(1); - mySplitter.setShowDividerIcon(false); - mySplitter.getDivider().setBackground(Gray._153.withAlpha(128)); - mySplitter.setShowDividerControls(false); - mySplitter.setOrientation(mySplitter.getOrientation()); + mySplitter.setOnePixelMode(); } installAutoScroll(); diff --git a/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java b/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java index faa26e2415b8..62864d01b91a 100644 --- a/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java +++ b/platform/platform-api/src/com/intellij/openapi/ui/ThreeComponentsSplitter.java @@ -26,6 +26,7 @@ import com.intellij.ui.UIBundle; import com.intellij.util.ui.update.Activatable; import com.intellij.util.ui.update.UiNotifyConnector; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.awt.*; @@ -56,9 +57,9 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { private final Divider myFirstDivider; private final Divider myLastDivider; - private JComponent myFirstComponent; - private JComponent myInnerComponent; - private JComponent myLastComponent; + @Nullable private JComponent myFirstComponent; + @Nullable private JComponent myInnerComponent; + @Nullable private JComponent myLastComponent; private int myFirstSize = 10; private int myLastSize = 10; @@ -303,6 +304,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { repaint(); } + @Nullable public JComponent getFirstComponent() { return myFirstComponent; } @@ -312,7 +314,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { * repaint the splitter. If there is already * */ - public void setFirstComponent(JComponent component) { + public void setFirstComponent(@Nullable JComponent component) { if (myFirstComponent != component) { if (myFirstComponent != null) { remove(myFirstComponent); @@ -325,6 +327,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { } } + @Nullable public JComponent getLastComponent() { return myLastComponent; } @@ -335,7 +338,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { * repaint the splitter. * */ - public void setLastComponent(JComponent component) { + public void setLastComponent(@Nullable JComponent component) { if (myLastComponent != component) { if (myLastComponent != null) { remove(myLastComponent); @@ -348,7 +351,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { } } - + @Nullable public JComponent getInnerComponent() { return myInnerComponent; } @@ -359,7 +362,7 @@ public class ThreeComponentsSplitter extends JPanel implements Disposable { * repaint the splitter. * */ - public void setInnerComponent(JComponent component) { + public void setInnerComponent(@Nullable JComponent component) { if (myInnerComponent != component) { if (myInnerComponent != null) { remove(myInnerComponent); |