context module for remote run configuration

This commit is contained in:
Eugene Zhuravlev
2010-09-21 19:12:53 +04:00
parent 78f15c9ca8
commit daa05e5365
3 changed files with 24 additions and 8 deletions
@@ -3,7 +3,7 @@
<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="482" height="367"/>
<xy x="64" y="1" width="605" height="391"/>
</constraints>
<properties/>
<border type="none"/>
@@ -16,11 +16,6 @@
<text resource-bundle="messages/ExecutionBundle" key="remote.configuration.remote.debugging.allows.you.to.connect.idea.to.a.running.jvm.label"/>
</properties>
</component>
<vspacer id="3ca11">
<constraints>
<grid row="4" 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>
<grid id="e37d3" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="5" vgap="8">
<margin top="3" left="5" bottom="5" right="5"/>
<constraints>
@@ -178,6 +173,15 @@
</constraints>
<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"/>
</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"/>
</properties>
</component>
</children>
</grid>
</form>
@@ -23,8 +23,11 @@ package com.intellij.execution.remote;
import com.intellij.execution.ExecutionBundle;
import com.intellij.execution.configurations.RemoteConnection;
import com.intellij.execution.ui.ConfigurationArgumentsHelpArea;
import com.intellij.execution.ui.ConfigurationModuleSelector;
import com.intellij.openapi.options.ConfigurationException;
import com.intellij.openapi.options.SettingsEditor;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.LabeledComponent;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.ui.DocumentAdapter;
import org.jetbrains.annotations.NonNls;
@@ -48,11 +51,14 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
private JPanel mySocketPanel;
private ConfigurationArgumentsHelpArea myHelpArea;
@NonNls private ConfigurationArgumentsHelpArea myJDK13HelpArea;
private LabeledComponent<JComboBox> myModule;
private String myHostName = "";
@NonNls
protected static final String LOCALHOST = "localhost";
private final ConfigurationModuleSelector myModuleSelector;
public RemoteConfigurable() {
public RemoteConfigurable(final Project project) {
myJDK13HelpArea.setLabelText(ExecutionBundle.message("environment.variables.helper.use.arguments.jdk13.label"));
final ButtonGroup transportGroup = new ButtonGroup();
@@ -115,6 +121,8 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
};
myAddressField.addFocusListener(fieldFocusListener);
myPortField.addFocusListener(fieldFocusListener);
myModuleSelector = new ConfigurationModuleSelector(project, myModule.getComponent());
}
public void applyEditorTo(@NotNull final RemoteConfiguration configuration) throws ConfigurationException {
@@ -132,6 +140,7 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
}
configuration.USE_SOCKET_TRANSPORT = myRbSocket.isSelected();
configuration.SERVER_MODE = myRbListen.isSelected();
myModuleSelector.applyTo(configuration);
}
public void resetEditorFrom(final RemoteConfiguration configuration) {
@@ -157,6 +166,7 @@ public class RemoteConfigurable extends SettingsEditor<RemoteConfiguration> {
myRbAttach.doClick();
}
myRbShmem.setEnabled(SystemInfo.isWindows);
myModuleSelector.reset(configuration);
}
@NotNull
@@ -44,11 +44,13 @@ public class RemoteConfiguration extends ModuleBasedConfiguration<JavaRunConfigu
public void writeExternal(final Element element) throws WriteExternalException {
super.writeExternal(element);
writeModule(element);
DefaultJDOMExternalizer.writeExternal(this, element);
}
public void readExternal(final Element element) throws InvalidDataException {
super.readExternal(element);
readModule(element);
DefaultJDOMExternalizer.readExternal(this, element);
}
@@ -76,7 +78,7 @@ public class RemoteConfiguration extends ModuleBasedConfiguration<JavaRunConfigu
public SettingsEditor<? extends RunConfiguration> getConfigurationEditor() {
SettingsEditorGroup<RemoteConfiguration> group = new SettingsEditorGroup<RemoteConfiguration>();
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new RemoteConfigurable());
group.addEditor(ExecutionBundle.message("run.configuration.configuration.tab.title"), new RemoteConfigurable(getProject()));
group.addEditor(ExecutionBundle.message("logs.tab.title"), new LogConfigurationPanel<RemoteConfiguration>());
return group;
}