use of com.intellij.ui.RawCommandLineEditor in project intellij-community by JetBrains.
the class ExternalSystemTaskSettingsControl method fillUi.
@Override
public void fillUi(@NotNull final PaintAwarePanel canvas, int indentLevel) {
myProjectPathLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.project", myExternalSystemId.getReadableName()));
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(myExternalSystemId);
FileChooserDescriptor projectPathChooserDescriptor = null;
if (manager instanceof ExternalSystemUiAware) {
projectPathChooserDescriptor = ((ExternalSystemUiAware) manager).getExternalProjectConfigDescriptor();
}
if (projectPathChooserDescriptor == null) {
projectPathChooserDescriptor = FileChooserDescriptorFactory.createSingleLocalFileDescriptor();
}
String title = ExternalSystemBundle.message("settings.label.select.project", myExternalSystemId.getReadableName());
myProjectPathField = new ExternalProjectPathField(myProject, myExternalSystemId, projectPathChooserDescriptor, title) {
@Override
public Dimension getPreferredSize() {
return myVmOptionsEditor == null ? super.getPreferredSize() : myVmOptionsEditor.getTextField().getPreferredSize();
}
};
canvas.add(myProjectPathLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myProjectPathField, ExternalSystemUiUtil.getFillLineConstraints(0));
myTasksLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.tasks"));
myTasksTextField = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
canvas.add(myTasksLabel, ExternalSystemUiUtil.getLabelConstraints(0));
GridBag c = ExternalSystemUiUtil.getFillLineConstraints(0);
c.insets.right = myProjectPathField.getButton().getPreferredSize().width + 8;
canvas.add(myTasksTextField, c);
new TaskCompletionProvider(myProject, myExternalSystemId, myProjectPathField).apply(myTasksTextField);
myVmOptionsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
myVmOptionsEditor = new RawCommandLineEditor();
myVmOptionsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.vmoptions"));
canvas.add(myVmOptionsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myVmOptionsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
myArgumentsLabel = new JBLabel(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
myArgumentsEditor = new RawCommandLineEditor();
myArgumentsEditor.setDialogCaption(ExternalSystemBundle.message("run.configuration.settings.label.arguments"));
canvas.add(myArgumentsLabel, ExternalSystemUiUtil.getLabelConstraints(0));
canvas.add(myArgumentsEditor, ExternalSystemUiUtil.getFillLineConstraints(0));
}
use of com.intellij.ui.RawCommandLineEditor in project intellij-community by JetBrains.
the class CommonProgramParametersPanel method copyDialogCaption.
protected void copyDialogCaption(final LabeledComponent<RawCommandLineEditor> component) {
final RawCommandLineEditor rawCommandLineEditor = component.getComponent();
rawCommandLineEditor.setDialogCaption(component.getRawText());
component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
}
use of com.intellij.ui.RawCommandLineEditor in project Perl5-IDEA by Camelcade.
the class PerlConfigurationEditor method getGeneralComponent.
@Nullable
@Override
protected JComponent getGeneralComponent() {
myScriptField = new TextFieldWithBrowseButton();
myScriptField.addBrowseFolderListener(PerlBundle.message("perl.run.config.select.script.header"), PerlBundle.message("perl.run.config.select.script.prompt"), myProject, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor().withFileFilter(PerlConfigurationProducer::isExecutableFile), TextComponentAccessor.TEXT_FIELD_WHOLE_TEXT);
myConsoleCharset = new ComboBox(new CollectionComboBoxModel(new ArrayList<>(Charset.availableCharsets().keySet())));
myScriptField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(DocumentEvent documentEvent) {
VirtualFile file = LocalFileSystem.getInstance().findFileByPath(myScriptField.getText());
if (file != null) {
myConsoleCharset.setSelectedItem(file.getCharset().displayName());
} else {
myConsoleCharset.setSelectedItem(null);
}
}
});
myAlternativeSdkPanel = new PerlAlternativeSdkPanel();
myParametersPanel = new CommonProgramParametersPanel() {
@Override
protected void addComponents() {
LabeledComponent<?> scriptLabel = LabeledComponent.create(myScriptField, PerlBundle.message("perl.run.option.script"));
scriptLabel.setLabelLocation(BorderLayout.WEST);
add(scriptLabel);
LabeledComponent<?> consoleEncoding = LabeledComponent.create(myConsoleCharset, PerlBundle.message("perl.run.option.output.encoding"));
consoleEncoding.setLabelLocation(BorderLayout.WEST);
add(consoleEncoding);
myPerlParametersPanel = new RawCommandLineEditor();
LabeledComponent<RawCommandLineEditor> perlParametersPanel = LabeledComponent.create(myPerlParametersPanel, PerlBundle.message("perl.run.option.perl.parameters"));
perlParametersPanel.setLabelLocation(BorderLayout.WEST);
copyDialogCaption(perlParametersPanel);
add(perlParametersPanel);
super.addComponents();
add(myAlternativeSdkPanel);
setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 5, true, false));
}
};
myParametersPanel.setProgramParametersLabel(PerlBundle.message("perl.run.option.script.parameters"));
return myParametersPanel;
}
use of com.intellij.ui.RawCommandLineEditor in project moe-ide-integration by multi-os-engine.
the class ArgumentsPanel method initComponents.
protected void initComponents() {
myVMParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), "VM options:");
copyDialogCaption(myVMParametersComponent);
myVMParametersComponent.setLabelLocation(BorderLayout.CENTER);
myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(), "Program arguments:");
myEnvVariablesComponent = new EnvironmentVariablesComponent();
myEnvVariablesComponent.setLabelLocation(BorderLayout.CENTER);
myProgramParametersComponent.setLabelLocation(BorderLayout.CENTER);
copyDialogCaption(myProgramParametersComponent);
addComponents();
setPreferredSize(new Dimension(10, 10));
setAnchor(myEnvVariablesComponent.getLabel());
}
use of com.intellij.ui.RawCommandLineEditor in project moe-ide-integration by multi-os-engine.
the class ArgumentsPanel method copyDialogCaption.
protected void copyDialogCaption(LabeledComponent<RawCommandLineEditor> component) {
RawCommandLineEditor rawCommandLineEditor = (RawCommandLineEditor) component.getComponent();
rawCommandLineEditor.setDialogCaption(component.getRawText());
component.getLabel().setLabelFor(rawCommandLineEditor.getTextField());
}
Aggregations