Align modules in Configure Kotlin dialog

This commit is contained in:
Natalia.Ukhorskaya
2013-09-17 15:36:47 +04:00
parent 4e0449a7a4
commit 706aa039dc
2 changed files with 26 additions and 11 deletions
@@ -8,20 +8,12 @@
<properties/>
<border type="none"/>
<children>
<component id="6717d" class="javax.swing.JRadioButton" binding="allModulesWithKtRadioButton" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="3" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="All modules containing Kotlin files: "/>
</properties>
</component>
<component id="e348f" class="javax.swing.JRadioButton" binding="singleModuleRadioButton" default-binding="true">
<constraints>
<grid row="1" column="0" 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="Single module"/>
<text value="Single module:"/>
</properties>
</component>
<component id="8acf5" class="javax.swing.JComboBox" binding="singleModuleComboBox">
@@ -43,6 +35,26 @@
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="5ca07" class="javax.swing.JTextField" binding="allModulesNames">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
<maximum-size width="-1" height="100"/>
</grid>
</constraints>
<properties>
<editable value="false"/>
<enabled value="true"/>
</properties>
</component>
<component id="6717d" class="javax.swing.JRadioButton" binding="allModulesWithKtRadioButton" default-binding="true">
<constraints>
<grid row="0" column="0" 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="All modules containing Kotlin files: "/>
</properties>
</component>
</children>
</grid>
</form>
@@ -24,6 +24,7 @@ import com.intellij.util.Function;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Collections;
@@ -35,6 +36,7 @@ public class ChooseModulePanel {
private JRadioButton singleModuleRadioButton;
private JComboBox singleModuleComboBox;
private JSeparator separator;
private JTextField allModulesNames;
@NotNull private final Project project;
@NotNull private final List<Module> modules;
@@ -62,14 +64,15 @@ public class ChooseModulePanel {
updateComponents();
}
});
String fullList = StringUtil.join(modules, new Function<Module, String>() {
@Override
public String fun(Module module) {
return module.getName();
}
}, ", ");
allModulesWithKtRadioButton.setText(allModulesWithKtRadioButton.getText() + StringUtil.shortenTextWithEllipsis(fullList, 80, 0));
allModulesNames.setText(fullList);
allModulesNames.setBorder(null);
ButtonGroup modulesGroup = new ButtonGroup();
modulesGroup.add(allModulesWithKtRadioButton);