本文整理汇总了Java中com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField类的典型用法代码示例。如果您正苦于以下问题:Java ExternalProjectPathField类的具体用法?Java ExternalProjectPathField怎么用?Java ExternalProjectPathField使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ExternalProjectPathField类属于com.intellij.openapi.externalSystem.service.ui包,在下文中一共展示了ExternalProjectPathField类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: collapseIfPossible
import com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField; //导入依赖的package包/类
private static void collapseIfPossible(@NotNull EditorTextField editorTextField,
@NotNull ProjectSystemId systemId,
@NotNull Project project) {
Editor editor = editorTextField.getEditor();
if (editor != null) {
String rawText = editor.getDocument().getText();
if (StringUtil.isEmpty(rawText)) return;
if (EMPTY_PARENT.equals(rawText)) {
editorTextField.setEnabled(false);
return;
}
final Collection<ExternalProjectInfo> projectsData =
ProjectDataManager.getInstance().getExternalProjectsData(project, systemId);
for (ExternalProjectInfo projectInfo : projectsData) {
if (projectInfo.getExternalProjectStructure() != null && projectInfo.getExternalProjectPath().equals(rawText)) {
editorTextField.setEnabled(true);
ExternalProjectPathField.collapse(
editorTextField.getEditor(), projectInfo.getExternalProjectStructure().getData().getExternalName());
return;
}
}
}
}
示例2: setUpDialog
import com.intellij.openapi.externalSystem.service.ui.ExternalProjectPathField; //导入依赖的package包/类
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);
}