Search in sources :

Example 1 with EnvironmentVariablesComponent

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);
}
Also used : TextFieldWithBrowseButton(com.intellij.openapi.ui.TextFieldWithBrowseButton) MacroAwareTextBrowseFolderListener(com.intellij.ui.MacroAwareTextBrowseFolderListener) FileChooserDescriptor(com.intellij.openapi.fileChooser.FileChooserDescriptor) ActionEvent(java.awt.event.ActionEvent) RawCommandLineEditor(com.intellij.ui.RawCommandLineEditor) EnvironmentVariablesComponent(com.intellij.execution.configuration.EnvironmentVariablesComponent)

Example 2 with EnvironmentVariablesComponent

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;
}
Also used : RawCommandLineEditor(com.intellij.ui.RawCommandLineEditor) EnvironmentVariablesComponent(com.intellij.execution.configuration.EnvironmentVariablesComponent) ExternalSystemJdkComboBox(com.intellij.openapi.externalSystem.service.ui.ExternalSystemJdkComboBox)

Aggregations

EnvironmentVariablesComponent (com.intellij.execution.configuration.EnvironmentVariablesComponent)2 RawCommandLineEditor (com.intellij.ui.RawCommandLineEditor)2 ExternalSystemJdkComboBox (com.intellij.openapi.externalSystem.service.ui.ExternalSystemJdkComboBox)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)1 MacroAwareTextBrowseFolderListener (com.intellij.ui.MacroAwareTextBrowseFolderListener)1 ActionEvent (java.awt.event.ActionEvent)1