s¨ˆˆˆ

This commit is contained in:
Konstantin Bulenkov
2011-07-13 14:59:08 +04:00
committed by Evgeny Zakrevsky
parent 4b4324e9a0
commit 8960977bfb
4 changed files with 193 additions and 181 deletions
@@ -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() {
@@ -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) {
@@ -1,204 +1,198 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.openapi.vcs.changes.ui.CommitLegendPanel">
<grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="9" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="myRootPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
<xy x="20" y="20" width="200" height="228"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="61fbc" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.files"/>
</properties>
</component>
<hspacer id="f4b2c">
<constraints>
<grid row="1" column="3" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<vspacer id="2b29a">
<constraints>
<grid row="8" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="4b73" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.shown"/>
</properties>
</component>
<component id="23f6b" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.included"/>
</properties>
</component>
<component id="97520" class="javax.swing.JSeparator">
<constraints>
<grid row="6" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="b8400" class="javax.swing.JLabel" binding="myModifiedShown">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="e3e31" class="javax.swing.JLabel" binding="myModifiedIncluded">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="d282c" class="javax.swing.JLabel" binding="myNewShown">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="6b5fd" class="javax.swing.JLabel" binding="myNewIncluded">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4d448" class="javax.swing.JLabel" binding="myDeletedShown">
<constraints>
<grid row="5" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4836c" class="javax.swing.JLabel" binding="myDeletedIncluded">
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="bf4d3" class="javax.swing.JLabel" binding="myTotalShown">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="1"/>
</properties>
</component>
<component id="9bacb" class="javax.swing.JLabel" binding="myTotalIncluded">
<constraints>
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<grid id="b2e92" binding="myModifiedPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="44206" layout-manager="GridLayoutManager" row-count="7" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="9" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="line"/>
<clientProperties>
<BorderFactoryClass class="java.lang.String" value="com.intellij.ui.IdeBorderFactory"/>
</clientProperties>
<border type="none" title-resource-bundle="messages/VcsBundle" title-key="commit.legend.summary"/>
<children>
<component id="a7590" class="javax.swing.JLabel" binding="myModifiedLabel">
<component id="61fbc" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.modified"/>
<text resource-bundle="messages/VcsBundle" key="commit.legend.files"/>
</properties>
</component>
</children>
</grid>
<grid id="b6a5f" binding="myNewPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="5d89e" class="javax.swing.JLabel" binding="myNewLabel">
<component id="4b73" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.new"/>
<text resource-bundle="messages/VcsBundle" key="commit.legend.shown"/>
</properties>
</component>
</children>
</grid>
<grid id="db816" binding="myDeletedPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="1f74b" class="javax.swing.JLabel" binding="myDeletedLabel">
<component id="23f6b" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.deleted"/>
<text resource-bundle="messages/VcsBundle" key="commit.legend.included"/>
</properties>
</component>
</children>
</grid>
<component id="caf79" class="javax.swing.JSeparator">
<constraints>
<grid row="2" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<grid id="2e2f4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="7" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="50838" class="javax.swing.JLabel">
<component id="97520" class="javax.swing.JSeparator">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
<grid row="5" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="b8400" class="javax.swing.JLabel" binding="myModifiedShown">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.total"/>
<text value="0"/>
</properties>
</component>
<component id="e3e31" class="javax.swing.JLabel" binding="myModifiedIncluded">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="d282c" class="javax.swing.JLabel" binding="myNewShown">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="6b5fd" class="javax.swing.JLabel" binding="myNewIncluded">
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4d448" class="javax.swing.JLabel" binding="myDeletedShown">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="4836c" class="javax.swing.JLabel" binding="myDeletedIncluded">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<component id="bf4d3" class="javax.swing.JLabel" binding="myTotalShown">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="1"/>
</properties>
</component>
<component id="9bacb" class="javax.swing.JLabel" binding="myTotalIncluded">
<constraints>
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="0"/>
</properties>
</component>
<grid id="b2e92" binding="myModifiedPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="a7590" class="javax.swing.JLabel" binding="myModifiedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.modified"/>
</properties>
</component>
</children>
</grid>
<grid id="b6a5f" binding="myNewPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="5d89e" class="javax.swing.JLabel" binding="myNewLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.new"/>
</properties>
</component>
</children>
</grid>
<grid id="db816" binding="myDeletedPanel" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
</constraints>
<properties/>
<border type="line"/>
<children>
<component id="1f74b" class="javax.swing.JLabel" binding="myDeletedLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.deleted"/>
</properties>
</component>
</children>
</grid>
<component id="caf79" class="javax.swing.JSeparator">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="0" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<grid id="2e2f4" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="50838" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text resource-bundle="messages/VcsBundle" key="commit.legend.total"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
<grid id="fadb9" binding="myHeadingPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="4" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children/>
</grid>
</children>
</grid>
</form>
@@ -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,