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);
}
Aggregations