use of com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField 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.openapi.externalSystem.service.ui.ExternalProjectPathField in project intellij-community by JetBrains.
the class GradleRunTaskDialog method setUpDialog.
private void setUpDialog() {
JComponent commandLineComponent;
if (myHistory == null) {
commandLineEditor = new EditorTextField("", myProject, PlainTextFileType.INSTANCE);
commandLineComponent = commandLineEditor;
commandLineLabel.setLabelFor(commandLineEditor);
} else {
commandLineComboBox = new ComboBox(ArrayUtilRt.toStringArray(myHistory));
commandLineComponent = commandLineComboBox;
commandLineLabel.setLabelFor(commandLineComboBox);
commandLineComboBox.setLightWeightPopupEnabled(false);
EditorComboBoxEditor editor = new StringComboboxEditor(myProject, PlainTextFileType.INSTANCE, commandLineComboBox);
//noinspection GtkPreferredJComboBoxRenderer
commandLineComboBox.setRenderer(new EditorComboBoxRenderer(editor));
commandLineComboBox.setEditable(true);
commandLineComboBox.setEditor(editor);
commandLineComboBox.setFocusable(true);
commandLineEditor = editor.getEditorComponent();
}
commandLinePanel.add(commandLineComponent);
ExternalSystemManager<?, ?, ?, ?, ?> manager = ExternalSystemApiUtil.getManager(GradleConstants.SYSTEM_ID);
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", GradleConstants.SYSTEM_ID.getReadableName());
myProjectPathField = new ExternalProjectPathField(myProject, GradleConstants.SYSTEM_ID, projectPathChooserDescriptor, title) {
@Override
public Dimension getPreferredSize() {
return commandLinePanel == null ? super.getPreferredSize() : commandLinePanel.getPreferredSize();
}
};
projectPathFieldPanel.add(myProjectPathField);
new GradleArgumentsCompletionProvider(myProject, myProjectPathField).apply(commandLineEditor);
}
Aggregations