use of org.jetbrains.plugins.gradle.service.execution.GradleArgumentsCompletionProvider 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