use of com.intellij.execution.configuration.EnvironmentVariablesComponent in project intellij-community by JetBrains.
the class CommonProgramParametersPanel method initComponents.
protected void initComponents() {
myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), ExecutionBundle.message("run.configuration.program.parameters"));
FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
//noinspection DialogTitleCapitalization
fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
myWorkingDirectoryField = new TextFieldWithBrowseButton();
myWorkingDirectoryField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(fileChooserDescriptor, getProject()) {
@Override
public void actionPerformed(ActionEvent e) {
myFileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
setProject(getProject());
super.actionPerformed(e);
}
});
myWorkingDirectoryComponent = LabeledComponent.create(createComponentWithMacroBrowse(myWorkingDirectoryField), ExecutionBundle.message("run.configuration.working.directory.label"));
myEnvVariablesComponent = new EnvironmentVariablesComponent();
myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);
addComponents();
setPreferredSize(new Dimension(10, 10));
copyDialogCaption(myProgramParametersComponent);
}
use of com.intellij.execution.configuration.EnvironmentVariablesComponent in project intellij-community by JetBrains.
the class MavenRunnerPanel method createComponent.
public JComponent createComponent() {
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.WEST;
c.insets.bottom = 5;
myRunInBackgroundCheckbox = new JCheckBox("Run in background");
myRunInBackgroundCheckbox.setMnemonic('b');
if (!myRunConfigurationMode) {
c.gridx = 0;
c.gridy++;
c.weightx = 1;
c.gridwidth = GridBagConstraints.REMAINDER;
panel.add(myRunInBackgroundCheckbox, c);
}
c.gridwidth = 1;
JLabel labelVMParameters = new JLabel("VM Options:");
labelVMParameters.setDisplayedMnemonic('v');
labelVMParameters.setLabelFor(myVMParametersEditor = new RawCommandLineEditor());
myVMParametersEditor.setDialogCaption(labelVMParameters.getText());
c.gridx = 0;
c.gridy++;
c.weightx = 0;
panel.add(labelVMParameters, c);
c.gridx = 1;
c.weightx = 1;
c.insets.left = 10;
panel.add(myVMParametersEditor, c);
c.insets.left = 0;
JLabel jdkLabel = new JLabel("JRE:");
jdkLabel.setDisplayedMnemonic('j');
jdkLabel.setLabelFor(myJdkCombo = new ExternalSystemJdkComboBox(myProject));
c.gridx = 0;
c.gridy++;
c.weightx = 0;
panel.add(jdkLabel, c);
c.gridx = 1;
c.weightx = 1;
c.fill = GridBagConstraints.NONE;
c.insets.left = 10;
panel.add(myJdkCombo, c);
c.insets.left = 0;
c.fill = GridBagConstraints.HORIZONTAL;
myEnvVariablesComponent = new EnvironmentVariablesComponent();
myEnvVariablesComponent.setPassParentEnvs(true);
myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
c.gridx = 0;
c.gridy++;
c.weightx = 1;
c.gridwidth = 2;
panel.add(myEnvVariablesComponent, c);
c.gridwidth = 1;
JPanel propertiesPanel = new JPanel(new BorderLayout());
propertiesPanel.setBorder(IdeBorderFactory.createTitledBorder("Properties", false));
propertiesPanel.add(mySkipTestsCheckBox = new JCheckBox("Skip tests"), BorderLayout.NORTH);
mySkipTestsCheckBox.setMnemonic('t');
collectProperties();
propertiesPanel.add(myPropertiesPanel = new MavenPropertiesPanel(myProperties), BorderLayout.CENTER);
myPropertiesPanel.getEmptyText().setText("No properties defined");
c.gridx = 0;
c.gridy++;
c.weightx = c.weighty = 1;
c.gridwidth = c.gridheight = GridBagConstraints.REMAINDER;
c.fill = GridBagConstraints.BOTH;
panel.add(propertiesPanel, c);
return panel;
}
Aggregations