From 8960977bfb098a8e5828cd4b53cd6722536b3c77 Mon Sep 17 00:00:00 2001 From: Konstantin Bulenkov Date: Wed, 13 Jul 2011 12:08:51 +0400 Subject: [PATCH] =?UTF-8?q?s=C2=A8=CB=86=CB=86=CB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extractMethod/ExtractMethodDialog.java | 25 +- .../changes/ui/CommitChangeListDialog.java | 20 +- .../vcs/changes/ui/CommitLegendPanel.form | 324 +++++++++--------- .../vcs/changes/ui/CommitLegendPanel.java | 5 - 4 files changed, 193 insertions(+), 181 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java index 1eb37c560ab6..6851942f994e 100644 --- a/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java +++ b/java/java-impl/src/com/intellij/refactoring/extractMethod/ExtractMethodDialog.java @@ -37,6 +37,7 @@ import com.intellij.ui.SeparatorFactory; import com.intellij.util.IncorrectOperationException; import com.intellij.util.VisibilityUtil; import com.intellij.util.containers.MultiMap; +import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NonNls; import javax.swing.*; @@ -44,10 +45,7 @@ import javax.swing.border.Border; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; import java.awt.*; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; +import java.awt.event.*; import java.util.Arrays; @@ -353,12 +351,27 @@ public class ExtractMethodDialog extends AbstractExtractDialog { protected void createParametersPanel() { if (myParamTable != null) { myCenterPanel.remove(myParamTable); - } else { - myCenterPanel.add(SeparatorFactory.createSeparator("&Parameters", myParamTable), BorderLayout.NORTH); } myParamTable = createParameterTableComponent(); myCenterPanel.add(myParamTable, BorderLayout.CENTER); + final JTable table = UIUtil.findComponentOfType(myParamTable, JTable.class); + myCenterPanel.add(SeparatorFactory.createSeparator("&Parameters", table), BorderLayout.NORTH); + if (table != null) { + table.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent e) { + if (table.getRowCount() > 0) { + final int col = table.getSelectedColumn(); + final int row = table.getSelectedRow(); + if (col == -1 || row == -1) { + table.getSelectionModel().setSelectionInterval(0, 0); + table.getColumnModel().getSelectionModel().setSelectionInterval(0, 0); + } + } + } + }); + } } protected ParameterTablePanel createParameterTableComponent() { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java index 5b4421f3c0e8..7189018fee26 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitChangeListDialog.java @@ -318,7 +318,8 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj if (options != null) { JPanel vcsOptions = new JPanel(new BorderLayout()); vcsOptions.add(options.getComponent(), BorderLayout.CENTER); - vcsOptions.add(SeparatorFactory.createSeparator(vcs.getDisplayName(), null), BorderLayout.NORTH); + vcsOptions.setBorder(IdeBorderFactory.createTitledBorder(vcs.getDisplayName())); + //vcsOptions.add(SeparatorFactory.createSeparator(vcs.getDisplayName(), null), BorderLayout.NORTH); vcsCommitOptions.add(vcsOptions); myPerVcsOptionsPanels.put(vcs, vcsOptions); myAdditionalComponents.add(options); @@ -362,16 +363,25 @@ public class CommitChangeListDialog extends DialogWrapper implements CheckinProj final String actionName = getCommitActionName(); final String borderTitleName = actionName.replace("_", ""); + //final String borderTitleName = actionName; if (beforeVisible) { beforeBox.add(Box.createVerticalGlue()); - beforeBox.add(SeparatorFactory.createSeparator(VcsBundle.message("border.standard.checkin.options.group", borderTitleName), null), 0); - optionsBox.add(beforeBox); + JPanel beforePanel = new JPanel(new BorderLayout()); + beforePanel.add(beforeBox); + beforePanel.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.standard.checkin.options.group", borderTitleName))); + //beforeBox.add(SeparatorFactory.createSeparatorWithBoldTitle(VcsBundle.message("border.standard.checkin.options.group", borderTitleName), null), 0); + //optionsBox.add(beforeBox); + optionsBox.add(beforePanel); } if (afterVisible) { afterBox.add(Box.createVerticalGlue()); - afterBox.add(SeparatorFactory.createSeparator(VcsBundle.message("border.standard.after.checkin.options.group", borderTitleName), null), 0); - optionsBox.add(afterBox); + JPanel afterPanel = new JPanel(new BorderLayout()); + afterPanel.add(afterBox); + afterPanel.setBorder(IdeBorderFactory.createTitledBorder(VcsBundle.message("border.standard.after.checkin.options.group", borderTitleName))); + //afterBox.add(SeparatorFactory.createSeparatorWithBoldTitle(VcsBundle.message("border.standard.after.checkin.options.group", borderTitleName), null), 0); + //optionsBox.add(afterBox); + optionsBox.add(afterPanel); } if (hasVcsOptions || beforeVisible || afterVisible) { diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form index ad82fc9fcc9d..6c38708008ea 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.form @@ -1,204 +1,198 @@
- + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + + + + - + - + - - - - - - - - - - - + - + - + - - - - - - - - - - - + - + - + - - - - - - - - - - - - - - - - - + - + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.java index 1863a9588ecb..d7d11aac9b47 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitLegendPanel.java @@ -43,7 +43,6 @@ public class CommitLegendPanel { private JLabel myNewLabel; private JPanel myDeletedPanel; private JLabel myDeletedLabel; - private JPanel myHeadingPanel; private final InfoCalculator myInfoCalculator; @@ -85,10 +84,6 @@ public class CommitLegendPanel { updateCategory(myDeletedShown, myDeletedIncluded, deleted, includedDeleted); } - private void createUIComponents() { - myHeadingPanel = (JPanel)SeparatorFactory.createSeparator(VcsBundle.message("commit.legend.summary"), null); - } - private static void updateCategory(JLabel totalLabel, JLabel includedLabel, int totalCnt,