Some UI fixes.

This commit is contained in:
Evgeny Zakrevsky
2012-03-13 15:44:17 +04:00
parent 543427c39c
commit e99111b6ca
5 changed files with 73 additions and 70 deletions
@@ -51,9 +51,9 @@ public class FrameworkSupportOptionsComponent {
layout.setVerticalFill(true);
myMainPanel = new JPanel(layout);
if (title != null) {
myMainPanel.setBorder(IdeBorderFactory.createTitledBorder(title, true));
}
//if (title != null) {
// myMainPanel.setBorder(IdeBorderFactory.createTitledBorder(title, true));
//}
final JComponent component = myConfigurable.createComponent();
if (component != null) {
@@ -124,7 +124,6 @@ public class PackageChooserDialog extends PackageChooser {
}
);
myTree.setBorder(BorderFactory.createEtchedBorder());
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTree);
scrollPane.setPreferredSize(new Dimension(500, 300));
@@ -127,8 +127,7 @@ public class UIUtil {
public static final int DEFAULT_HGAP = 10;
public static final int DEFAULT_VGAP = 4;
public static final int LARGE_HGAP = 30;
public static final int LARGE_VGAP = 20;
public static final int LARGE_VGAP = 12;
public static final Insets PANEL_REGULAR_INSETS = new Insets(8, 12, 8, 12);
public static final Insets PANEL_SMALL_INSETS = new Insets(5, 8, 5, 8);
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="org.jetbrains.idea.maven.utils.RepositoryAttachDialog">
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="myPanel" layout-manager="GridLayoutManager" row-count="4" column-count="2" 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"/>
@@ -8,91 +8,100 @@
<properties/>
<border type="none"/>
<children>
<component id="8107" class="javax.swing.JLabel" binding="myCaptionLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Description"/>
</properties>
</component>
<vspacer id="ab1b5">
<constraints>
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
<grid row="3" 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="4a8ee" class="com.intellij.ui.ComboboxWithBrowseButton" binding="myComboComponent">
<component id="df170" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="e800f" class="javax.swing.JCheckBox" binding="mySourcesCheckBox">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" 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 value="&amp;Sources"/>
<text value="Download to: "/>
</properties>
</component>
<component id="63ac5" class="javax.swing.JCheckBox" binding="myJavaDocCheckBox">
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Java&amp;Docs"/>
</properties>
</component>
<hspacer id="8d05c">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
<component id="d8f65" class="com.intellij.openapi.ui.TextFieldWithBrowseButton" binding="myDirectoryField">
<constraints>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value=""/>
</properties>
</component>
<component id="df170" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" 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 value="Download to Directory: "/>
</properties>
</component>
<grid id="9a1aa" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="8a0e6" layout-manager="GridLayoutManager" row-count="1" 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="0" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="2" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="9b6f0" class="com.intellij.util.ui.AsyncProcessIcon" binding="myProgressIcon" custom-create="true">
<component id="e800f" class="javax.swing.JCheckBox" binding="mySourcesCheckBox">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="24b5c" class="javax.swing.JLabel" binding="myInfoLabel">
<constraints>
<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"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Info"/>
<text value="&amp;Sources"/>
</properties>
</component>
<hspacer id="32d4b">
<component id="63ac5" class="javax.swing.JCheckBox" binding="myJavaDocCheckBox">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Java&amp;Docs"/>
</properties>
</component>
<hspacer id="8d05c">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
</hspacer>
</children>
</grid>
<grid id="c48e0" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="15" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="4a8ee" class="com.intellij.ui.ComboboxWithBrowseButton" binding="myComboComponent">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="9b6f0" class="com.intellij.util.ui.AsyncProcessIcon" binding="myProgressIcon" custom-create="true">
<constraints>
<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/>
</component>
<component id="466f1" class="com.intellij.ui.components.JBLabel" binding="myInfoLabel">
<constraints>
<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>
<componentStyle value="MINI"/>
<fontColor value="BRIGHTER"/>
<text value="Info"/>
</properties>
</component>
<component id="e17fc" class="com.intellij.ui.components.JBLabel" binding="myCaptionLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<componentStyle value="SMALL"/>
<fontColor value="BRIGHTER"/>
<text value="Description"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>
@@ -24,7 +24,6 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.project.ProjectBundle;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.MultiLineLabelUI;
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.ui.popup.JBPopupFactory;
@@ -37,6 +36,7 @@ import com.intellij.ui.CollectionComboBoxModel;
import com.intellij.ui.ComboboxWithBrowseButton;
import com.intellij.ui.DocumentAdapter;
import com.intellij.ui.awt.RelativePoint;
import com.intellij.ui.components.JBLabel;
import com.intellij.util.PairProcessor;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.util.ui.AsyncProcessIcon;
@@ -65,7 +65,7 @@ public class RepositoryAttachDialog extends DialogWrapper {
@NonNls private static final String PROPERTY_ATTACH_JAVADOC = "Repository.Attach.JavaDocs";
@NonNls private static final String PROPERTY_ATTACH_SOURCES = "Repository.Attach.Sources";
private JLabel myInfoLabel;
private JBLabel myInfoLabel;
private JCheckBox myJavaDocCheckBox;
private JCheckBox mySourcesCheckBox;
private final Project myProject;
@@ -73,7 +73,7 @@ public class RepositoryAttachDialog extends DialogWrapper {
private AsyncProcessIcon myProgressIcon;
private ComboboxWithBrowseButton myComboComponent;
private JPanel myPanel;
private JLabel myCaptionLabel;
private JBLabel myCaptionLabel;
private final THashMap<String, Pair<MavenArtifactInfo, MavenRepositoryInfo>> myCoordinates
= new THashMap<String, Pair<MavenArtifactInfo, MavenRepositoryInfo>>();
private final Map<String, MavenRepositoryInfo> myRepositories = new TreeMap<String, MavenRepositoryInfo>();
@@ -88,12 +88,8 @@ public class RepositoryAttachDialog extends DialogWrapper {
myProject = project;
myManaged = managed;
myProgressIcon.suspend();
myCaptionLabel.setText("Enter keyword, pattern or class name to search by or Maven coordinates,\n" +
"i.e. 'springframework', 'Logger' or 'org.hibernate:hibernate-core:3.5.0.GA':");
myCaptionLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
myCaptionLabel.setUI(new MultiLineLabelUI());
myInfoLabel.setUI(new MultiLineLabelUI());
myInfoLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
myCaptionLabel.setText("<html>" + StringUtil.escapeXml("enter keyword, pattern or class name to search by or Maven coordinates," +
"i.e. 'springframework', 'Logger' or 'org.hibernate:hibernate-core:3.5.0.GA':") + "</html>");
myInfoLabel.setPreferredSize(
new Dimension(myInfoLabel.getFontMetrics(myInfoLabel.getFont()).stringWidth("Showing: 1000"), myInfoLabel.getPreferredSize().height));
@@ -108,7 +104,7 @@ public class RepositoryAttachDialog extends DialogWrapper {
myCombobox.setModel(new CollectionComboBoxModel(myShownItems, null));
myCombobox.setEditable(true);
final JTextField textField = (JTextField)myCombobox.getEditor().getEditorComponent();
textField.setColumns(50);
textField.setColumns(20);
if (initialFilter != null) {
textField.setText(initialFilter);
}
@@ -257,7 +253,7 @@ public class RepositoryAttachDialog extends DialogWrapper {
}
private void updateInfoLabel() {
myInfoLabel.setText("Found: " + myCoordinates.size() + "\nShowing: " + myCombobox.getModel().getSize());
myInfoLabel.setText("<html>Found: " + myCoordinates.size() + "<br>Showing: " + myCombobox.getModel().getSize() + "</html>");
}
@Override