Search in sources :

Example 1 with MacroAwareTextBrowseFolderListener

use of com.intellij.ui.MacroAwareTextBrowseFolderListener 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)

Aggregations

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