Remote run configuration UI compacted

This commit is contained in:
Dmitry Avdeev
2012-07-26 13:40:23 +04:00
parent bb37cd20b9
commit b50491d586
6 changed files with 60 additions and 44 deletions
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.execution.remote.RemoteConfigurable">
<grid id="715ea" binding="myPanel" layout-manager="GridBagLayout">
<grid id="715ea" binding="myPanel" layout-manager="GridLayoutManager" row-count="5" 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="64" y="1" width="601" height="433"/>
<xy x="64" y="1" width="330" height="324"/>
</constraints>
<properties/>
<border type="none"/>
@@ -11,7 +12,6 @@
<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="false"/>
<gridbag weightx="1.0" weighty="0.0"/>
</constraints>
<properties/>
<clientProperties>
@@ -19,25 +19,17 @@
</clientProperties>
<border type="etched" title-resource-bundle="messages/ExecutionBundle" title-key="remote.configuration.settings.border"/>
<children>
<grid id="d0319" binding="mySocketPanel" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="d0319" binding="mySocketPanel" layout-manager="GridLayoutManager" row-count="1" column-count="4" 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="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="2" 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/>
<border type="none"/>
<children>
<component id="11a97" class="javax.swing.JTextField" binding="myPortField">
<constraints>
<grid row="1" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="76d9b" class="javax.swing.JTextField" binding="myHostField">
<constraints>
<grid row="0" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" 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="3" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -53,18 +45,26 @@
</component>
<component id="24ab6" class="javax.swing.JLabel">
<constraints>
<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"/>
<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/ExecutionBundle" key="remote.configuration.port.label"/>
</properties>
</component>
<component id="11a97" class="javax.swing.JTextField" binding="myPortField">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
</children>
</grid>
<grid id="446e3" binding="myShmemPanel" layout-manager="GridLayoutManager" row-count="1" 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>
<grid row="3" column="0" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="true"/>
<grid row="3" 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/>
<border type="none"/>
@@ -79,7 +79,7 @@
</component>
<component id="d75e1" class="javax.swing.JTextField" binding="myAddressField">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" 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="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
@@ -141,34 +141,38 @@
</grid>
<component id="aa30e" class="com.intellij.execution.ui.ConfigurationArgumentsHelpArea" binding="myHelpArea">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
<gridbag weightx="1.0" weighty="0.0"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<visible value="true"/>
</properties>
</component>
<component id="4362c" class="com.intellij.execution.ui.ConfigurationArgumentsHelpArea" binding="myJDK13HelpArea">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
<gridbag top="15" left="0" bottom="15" right="0" weightx="1.0" weighty="0.0"/>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<visible value="true"/>
</properties>
</component>
<component id="38070" class="com.intellij.openapi.ui.LabeledComponent" binding="myModule">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
<gridbag top="15" left="0" bottom="0" right="0" weightx="1.0" weighty="0.0"/>
</constraints>
<properties>
<componentClass value="javax.swing.JComboBox"/>
<text value="Search sources using the classpath of m&amp;odule (select &lt;no module&gt; to search across the whole project):" noi18n="true"/>
<labelLocation value="West"/>
<text value="Search sources using m&amp;odule's classpath:" noi18n="true"/>
<visible value="true"/>
</properties>
</component>
<component id="2e3b8" class="com.intellij.execution.ui.ConfigurationArgumentsHelpArea" binding="myJDK14HelpArea">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
<gridbag top="15" left="0" bottom="15" right="0" weightx="1.0" weighty="0.0"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="9" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<properties>
<visible value="true"/>
</properties>
</component>
</children>
</grid>
@@ -128,20 +128,20 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
myAddressField.addFocusListener(fieldFocusListener);
myPortField.addFocusListener(fieldFocusListener);
myModuleSelector = new ConfigurationModuleSelector(project, myModule.getComponent());
myModuleSelector = new ConfigurationModuleSelector(project, myModule.getComponent(), "<whole project>");
}
public void applyEditorTo(@NotNull final RemoteConfiguration configuration) throws ConfigurationException {
configuration.HOST = (myHostField.isEditable() ? myHostField.getText() : myHostName).trim();
if ("".equals(configuration.HOST)) {
if (configuration.HOST != null && configuration.HOST.isEmpty()) {
configuration.HOST = null;
}
configuration.PORT = myPortField.getText().trim();
if ("".equals(configuration.PORT)) {
if (configuration.PORT != null && configuration.PORT.isEmpty()) {
configuration.PORT = null;
}
configuration.SHMEM_ADDRESS = myAddressField.getText().trim();
if ("".equals(configuration.SHMEM_ADDRESS)) {
if (configuration.SHMEM_ADDRESS != null && configuration.SHMEM_ADDRESS.isEmpty()) {
configuration.SHMEM_ADDRESS = null;
}
configuration.USE_SOCKET_TRANSPORT = myRbSocket.isSelected();
@@ -3,14 +3,14 @@
<grid id="f0e0b" binding="myPanel" layout-manager="GridLayoutManager" row-count="2" 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="47" y="46" width="488" height="239"/>
<xy x="47" y="46" width="374" height="79"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="25a8e" class="javax.swing.JLabel" binding="myLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="2" fill="1" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="0" anchor="10" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<labelFor value="9e177"/>
@@ -19,9 +19,14 @@
</component>
<scrollpane id="f35c0" class="com.intellij.ui.components.JBScrollPane">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="100" height="-1"/>
</grid>
</constraints>
<properties/>
<properties>
<horizontalScrollBarPolicy value="31"/>
<visible value="true"/>
</properties>
<border type="none"/>
<children>
<component id="9e177" class="javax.swing.JTextArea" binding="myHelpArea">
@@ -29,7 +34,7 @@
<properties>
<editable value="false"/>
<lineWrap value="true"/>
<minimumSize width="250" height="16"/>
<visible value="true"/>
<wrapStyleWord value="true"/>
</properties>
</component>
@@ -19,6 +19,7 @@ import com.intellij.execution.ExecutionBundle;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.ide.CopyPasteManager;
import com.intellij.openapi.ui.FixedSizeButton;
import com.intellij.ui.IdeBorderFactory;
import com.intellij.ui.PopupHandler;
import com.intellij.util.PlatformIcons;
@@ -37,6 +38,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel {
public ConfigurationArgumentsHelpArea() {
super(new BorderLayout());
add(myPanel);
setBorder(IdeBorderFactory.createEmptyBorder(10, 0, 0, 0));
final DefaultActionGroup group = new DefaultActionGroup();
group.add(new MyCopyAction());
@@ -64,7 +66,7 @@ public class ConfigurationArgumentsHelpArea extends JPanel {
public void setToolbarVisible() {
myToolbarPanel.setVisible(true);
}
private static ActionPopupMenu createPopupMenu(DefaultActionGroup group) {
return ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
}
@@ -35,8 +35,8 @@ import java.util.Comparator;
import java.util.List;
public class ConfigurationModuleSelector {
private static final String NO_MODULE = "<no module>";
private final String myNoModule;
private final Project myProject;
private final JComboBox myModulesList;
private final SortedComboBoxModel<Object> myModules = new SortedComboBoxModel<Object>(new Comparator<Object>() {
@@ -49,6 +49,11 @@ public class ConfigurationModuleSelector {
});
public ConfigurationModuleSelector(final Project project, final JComboBox modulesList) {
this(project, modulesList, "<no module>");
}
public ConfigurationModuleSelector(final Project project, final JComboBox modulesList, String noModule) {
myNoModule = noModule;
myProject = project;
myModulesList = modulesList;
new ComboboxSpeedSearch(modulesList){
@@ -56,7 +61,7 @@ public class ConfigurationModuleSelector {
if (element instanceof Module){
return ((Module)element).getName();
} else if (element == null) {
return NO_MODULE;
return myNoModule;
}
return super.getElementText(element);
}
@@ -71,7 +76,7 @@ public class ConfigurationModuleSelector {
setText(module.getName());
}
else if (value == null) {
setText(NO_MODULE);
setText(myNoModule);
}
}
});