本文整理匯總了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);
}