mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
Revert "IDEADEV-41762 Run Configurations: Replace Working directory textfield with combobox with $MODULE_DIR$ macro predefined"
This reverts commit 7eeede6bb4.
This commit is contained in:
+14
-8
@@ -1,16 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.execution.junit2.configuration.CommonJavaParameters">
|
||||
<grid id="d88e6" binding="myWholePanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="10">
|
||||
<grid id="d88e6" binding="myWholePanel" row-count="3" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="10">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="64" y="62" width="431" height="161"/>
|
||||
<xy x="64" y="62" width="431" height="137"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3"/>
|
||||
</constraints>
|
||||
<properties/>
|
||||
<border type="none"/>
|
||||
<children>
|
||||
<component id="6e486" class="com.intellij.openapi.ui.LabeledComponent" binding="myVMParameters">
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<xy x="0" y="9" width="431" height="16"/>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1">
|
||||
<minimum-size width="0" height="-1"/>
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
@@ -22,7 +24,8 @@
|
||||
</component>
|
||||
<component id="acecf" class="com.intellij.openapi.ui.LabeledComponent" binding="myProgramParameters">
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false">
|
||||
<xy x="0" y="53" width="431" height="16"/>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1">
|
||||
<minimum-size width="0" height="-1"/>
|
||||
<preferred-size width="400" height="-1"/>
|
||||
</grid>
|
||||
@@ -32,13 +35,16 @@
|
||||
<text resource-bundle="messages/ExecutionBundle" key="junit.configuration.test.runner.parameters.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="2c8fa" class="com.intellij.openapi.ui.LabeledComponent" binding="myWorkingDirectoryCombo">
|
||||
<component id="8c18f" class="com.intellij.openapi.ui.LabeledComponent" binding="myWorkingDirectory">
|
||||
<constraints>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
|
||||
<xy x="0" y="94" width="431" height="36"/>
|
||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1">
|
||||
<minimum-size width="0" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties>
|
||||
<componentClass value="com.intellij.ui.ComboboxWithBrowseButton"/>
|
||||
<enabled value="true"/>
|
||||
<componentClass value="com.intellij.openapi.ui.TextFieldWithBrowseButton"/>
|
||||
<opaque value="true"/>
|
||||
<text resource-bundle="messages/ExecutionBundle" key="junit.configuration.working.directory.label"/>
|
||||
</properties>
|
||||
</component>
|
||||
|
||||
+4
-15
@@ -26,7 +26,6 @@ import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.ui.LabeledComponent;
|
||||
import com.intellij.openapi.ui.TextFieldWithBrowseButton;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.ui.ComboboxWithBrowseButton;
|
||||
import com.intellij.ui.RawCommandLineEditor;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -43,9 +42,9 @@ public class CommonJavaParameters extends JPanel {
|
||||
};
|
||||
|
||||
private JPanel myWholePanel;
|
||||
private LabeledComponent<TextFieldWithBrowseButton> myWorkingDirectory;
|
||||
private LabeledComponent<RawCommandLineEditor> myProgramParameters;
|
||||
private LabeledComponent<RawCommandLineEditor> myVMParameters;
|
||||
private LabeledComponent<ComboboxWithBrowseButton> myWorkingDirectoryCombo;
|
||||
|
||||
private final LabeledComponent[] myFields = new LabeledComponent[3];
|
||||
private Module myModule = null;
|
||||
@@ -55,27 +54,21 @@ public class CommonJavaParameters extends JPanel {
|
||||
add(myWholePanel, BorderLayout.CENTER);
|
||||
copyDialogCaption(myProgramParameters);
|
||||
copyDialogCaption(myVMParameters);
|
||||
|
||||
final JComboBox comboBox = myWorkingDirectoryCombo.getComponent().getChildComponent();
|
||||
comboBox.setEditable(true);
|
||||
comboBox.setModel(new DefaultComboBoxModel(new String[] {"$MODULE_DIR$"}));
|
||||
|
||||
myWorkingDirectoryCombo.getComponent()
|
||||
myWorkingDirectory.getComponent()
|
||||
.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
|
||||
fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
|
||||
fileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModule);
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myWorkingDirectoryCombo, fileChooserDescriptor);
|
||||
VirtualFile[] files = FileChooser.chooseFiles(myWorkingDirectory, fileChooserDescriptor);
|
||||
if (files.length != 0) {
|
||||
setText(RunJavaConfiguration.WORKING_DIRECTORY_PROPERTY, files[0].getPresentableUrl());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
myFields[RunJavaConfiguration.PROGRAM_PARAMETERS_PROPERTY] = myProgramParameters;
|
||||
myFields[RunJavaConfiguration.VM_PARAMETERS_PROPERTY] = myVMParameters;
|
||||
myFields[RunJavaConfiguration.WORKING_DIRECTORY_PROPERTY] = myWorkingDirectoryCombo;
|
||||
myFields[RunJavaConfiguration.WORKING_DIRECTORY_PROPERTY] = myWorkingDirectory;
|
||||
}
|
||||
|
||||
private static void copyDialogCaption(final LabeledComponent<RawCommandLineEditor> component) {
|
||||
@@ -111,8 +104,6 @@ public class CommonJavaParameters extends JPanel {
|
||||
((TextFieldWithBrowseButton)component).setText(value);
|
||||
else if (component instanceof RawCommandLineEditor)
|
||||
((RawCommandLineEditor)component).setText(value);
|
||||
else if (component instanceof ComboboxWithBrowseButton)
|
||||
((ComboboxWithBrowseButton)component).getChildComponent().setSelectedItem(value);
|
||||
else LOG.error(component.getClass().getName());
|
||||
}
|
||||
|
||||
@@ -122,8 +113,6 @@ public class CommonJavaParameters extends JPanel {
|
||||
return ((TextFieldWithBrowseButton)component).getText();
|
||||
else if (component instanceof RawCommandLineEditor)
|
||||
return ((RawCommandLineEditor)component).getText();
|
||||
else if (component instanceof ComboboxWithBrowseButton)
|
||||
return (String) ((ComboboxWithBrowseButton)component).getComboBox().getSelectedItem();
|
||||
else LOG.error(component.getClass().getName());
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user