Better UI for configure plugin updates (KT-23980)

- Control with Alt + Letter
 - Don't stretch channel combobox
 - Focus on label selection

 #KT-23980 Fixed
This commit is contained in:
Nikolay Krasko
2018-04-25 20:49:53 +03:00
parent 748e213598
commit 64845ac3b7
2 changed files with 18 additions and 5 deletions
@@ -13,7 +13,8 @@
<grid row="0" 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="Update channel:"/>
<labelFor value="ca1a9"/>
<text value="Update &amp;channel:"/>
</properties>
</component>
<vspacer id="42b13">
@@ -23,7 +24,7 @@
</vspacer>
<component id="ca1a9" class="javax.swing.JComboBox" binding="channelCombo">
<constraints>
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<model>
@@ -43,7 +44,7 @@
<component id="c7546" class="javax.swing.JButton" binding="checkForUpdatesNowButton" default-binding="true">
<constraints/>
<properties>
<text value="Check for updates now"/>
<text value="Check for updates &amp;now"/>
</properties>
</component>
<component id="3b585" class="com.intellij.util.ui.AsyncProcessIcon" binding="updateCheckProgressIcon" custom-create="true">
@@ -73,7 +74,7 @@
<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="Install"/>
<text value="&amp;Install"/>
<visible value="true"/>
</properties>
</component>
@@ -10,13 +10,25 @@ import com.intellij.util.ui.AsyncProcessIcon;
import javax.swing.*;
public class ConfigurePluginUpdatesForm {
public JComboBox channelCombo;
public JComboBox<String> channelCombo;
public JButton checkForUpdatesNowButton;
public JPanel mainPanel;
public AsyncProcessIcon updateCheckProgressIcon;
public JLabel updateStatusLabel;
public JButton installButton;
public ConfigurePluginUpdatesForm() {
int size = channelCombo.getModel().getSize();
String maxLengthItem = "";
for (int i = 0; i < size; i++) {
String item = channelCombo.getModel().getElementAt(i);
if (item.length() > maxLengthItem.length()) {
maxLengthItem = item;
}
}
channelCombo.setPrototypeDisplayValue(maxLengthItem + " ");
}
private void createUIComponents() {
updateCheckProgressIcon = new AsyncProcessIcon("Plugin update check progress");
}