From 560fd574cc3f64f2653c409fbe9722f4fed4edc6 Mon Sep 17 00:00:00 2001 From: Evgeny Zakrevsky Date: Mon, 21 May 2012 21:20:20 +0400 Subject: [PATCH] IDEA-86352 Problems with the UI settings --- .../ui/ExpressionEvaluationDialog.java | 9 +++++---- .../options/CodeStyleImportsPanel.java | 3 --- .../options/TabbedLanguageCodeStylePanel.java | 2 +- .../MultilanguageCodeStyleAbstractPanel.java | 4 +--- .../codeStyle/OptionTableWithPreviewPanel.java | 15 +++++++++------ .../codeStyle/OptionTreeWithPreviewPanel.java | 18 +++++++++++------- 6 files changed, 27 insertions(+), 24 deletions(-) diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java b/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java index e216c7cd2ea4..b7bdd9134769 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/ExpressionEvaluationDialog.java @@ -29,6 +29,7 @@ import com.intellij.openapi.actionSystem.CustomShortcutSet; import com.intellij.openapi.help.HelpManager; import com.intellij.openapi.project.Project; import com.intellij.ui.IdeBorderFactory; +import com.intellij.ui.components.JBLabel; import com.intellij.util.ui.UIUtil; import javax.swing.*; @@ -82,13 +83,13 @@ public class ExpressionEvaluationDialog extends EvaluationDialog { protected JComponent createCenterPanel() { final JPanel panel = new JPanel(new BorderLayout()); - final JPanel exprPanel = new JPanel(new BorderLayout()); + final JPanel exprPanel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, 0)); exprPanel.add(new JLabel(DebuggerBundle.message("label.evaluate.dialog.expression")), BorderLayout.WEST); exprPanel.add(getExpressionCombo(), BorderLayout.CENTER); - final JLabel help = new JLabel("Press Enter to Evaluate or Control+Enter to evaluate and add to the Watches", SwingConstants.RIGHT); + final JBLabel help = new JBLabel("Press Enter to Evaluate or Control+Enter to evaluate and add to the Watches", SwingConstants.RIGHT); help.setBorder(IdeBorderFactory.createEmptyBorder(2,0,6,0)); - UIUtil.applyStyle(UIUtil.ComponentStyle.MINI, help); - help.setForeground(UIUtil.getInactiveTextColor()); + help.setComponentStyle(UIUtil.ComponentStyle.SMALL); + help.setFontColor(UIUtil.FontColor.BRIGHTER); exprPanel.add(help, BorderLayout.SOUTH); diff --git a/java/java-impl/src/com/intellij/application/options/CodeStyleImportsPanel.java b/java/java-impl/src/com/intellij/application/options/CodeStyleImportsPanel.java index aae5ed814941..5ce8aaa763bf 100644 --- a/java/java-impl/src/com/intellij/application/options/CodeStyleImportsPanel.java +++ b/java/java-impl/src/com/intellij/application/options/CodeStyleImportsPanel.java @@ -52,9 +52,6 @@ public class CodeStyleImportsPanel extends JPanel { private final PackageEntryTable myPackageList = new PackageEntryTable(); private JBTable myImportLayoutTable; - private JButton myMoveUpButton; - private JButton myMoveDownButton; - private JButton myRemovePackageFromImportLayoutButton; private JBTable myPackageTable; private final CodeStyleSettings mySettings; private JRadioButton myJspImportCommaSeparated; diff --git a/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java b/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java index 7c67954ae2ae..29d6d25e52d9 100644 --- a/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/TabbedLanguageCodeStylePanel.java @@ -512,7 +512,7 @@ public abstract class TabbedLanguageCodeStylePanel extends CodeStyleAbstractPane super(settings); myProvider = provider; myTopPanel = new JPanel(); - myTopPanel.setLayout(new BorderLayout()); + myTopPanel.setLayout(new BorderLayout(8, 0)); myLeftPanel = new JPanel(new BorderLayout()); myTopPanel.add(myLeftPanel, BorderLayout.WEST); myRightPanel = new JPanel(); diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/MultilanguageCodeStyleAbstractPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/MultilanguageCodeStyleAbstractPanel.java index 028af62d9e17..69910417c7f3 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/MultilanguageCodeStyleAbstractPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/MultilanguageCodeStyleAbstractPanel.java @@ -207,9 +207,7 @@ public abstract class MultilanguageCodeStyleAbstractPanel extends CodeStyleAbstr } protected static JPanel createPreviewPanel() { - JPanel panel = new JPanel(new BorderLayout()); - panel.setPreferredSize(new Dimension(200, 0)); - return panel; + return new JPanel(new BorderLayout()); } diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java index 12cc00f51182..4719872ddb7e 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTableWithPreviewPanel.java @@ -75,16 +75,19 @@ public abstract class OptionTableWithPreviewPanel extends MultilanguageCodeStyle initTables(); myTreeTable = createOptionsTree(getSettings()); - JBScrollPane scrollPane = new JBScrollPane(myTreeTable); - scrollPane.setPreferredSize(new Dimension(400, -1)); - scrollPane.setMinimumSize(new Dimension(400, -1)); + JBScrollPane scrollPane = new JBScrollPane(myTreeTable) { + @Override + public Dimension getMinimumSize() { + return super.getPreferredSize(); + } + }; myPanel.add(scrollPane - , new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, - new Insets(0, 0, 0, 5), 0, 0)); + , new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 8), 0, 0)); final JPanel previewPanel = createPreviewPanel(); myPanel.add(previewPanel, - new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, + new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); installPreviewPanel(previewPanel); diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTreeWithPreviewPanel.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTreeWithPreviewPanel.java index 7f6bb64b0fe8..a53a19ea4d7a 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTreeWithPreviewPanel.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/OptionTreeWithPreviewPanel.java @@ -20,7 +20,7 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.psi.codeStyle.CodeStyleSettings; import com.intellij.psi.codeStyle.CommonCodeStyleSettings; import com.intellij.psi.codeStyle.CustomCodeStyleSettings; -import com.intellij.ui.ScrollPaneFactory; +import com.intellij.ui.components.JBScrollPane; import com.intellij.ui.treeStructure.Tree; import com.intellij.util.containers.MultiMap; import com.intellij.util.ui.UIUtil; @@ -69,17 +69,20 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA myOptionsTree = createOptionsTree(); myOptionsTree.setCellRenderer(new MyTreeCellRenderer()); - JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myOptionsTree); - scrollPane.setPreferredSize(new Dimension(350, -1)); - scrollPane.setMinimumSize(new Dimension(350, -1)); + JScrollPane scrollPane = new JBScrollPane(myOptionsTree) { + @Override + public Dimension getMinimumSize() { + return super.getPreferredSize(); + } + }; myPanel.add(scrollPane, - new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, - new Insets(0, 0, 0, 5), 0, 0)); + new GridBagConstraints(0, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, + new Insets(0, 0, 0, 8), 0, 0)); JPanel previewPanel = createPreviewPanel(); myPanel.add(previewPanel, - new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.WEST, GridBagConstraints.BOTH, + new GridBagConstraints(1, 0, 1, 1, 1, 1, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); installPreviewPanel(previewPanel); @@ -421,6 +424,7 @@ public abstract class OptionTreeWithPreviewPanel extends MultilanguageCodeStyleA else { myLabel.setText(value.toString()); myLabel.setFont(myLabel.getFont().deriveFont(Font.BOLD)); + myLabel.setOpaque(true); if (isSelected) { myLabel.setForeground(UIUtil.getTreeSelectionForeground());