Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Suggestion Provider for Crossref during autocompletion disable #10829

Merged
merged 8 commits into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,8 @@ private void setupAutoCompletion() {
suggestionProviders = new SuggestionProviders(getDatabase(), Globals.journalAbbreviationRepository, autoCompletePreferences);
} else {
// Create empty suggestion providers if auto-completion is deactivated
pal-anish marked this conversation as resolved.
Show resolved Hide resolved
suggestionProviders = new SuggestionProviders();
// suggestionProviders = new SuggestionProviders();
suggestionProviders = new SuggestionProviders(getDatabase());
}
searchAutoCompleter = new PersonNameSuggestionProvider(FieldFactory.getPersonNameFields(), getDatabase());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,26 @@ public SuggestionProviders(BibDatabase database, JournalAbbreviationRepository a
this.isEmpty = false;
}

public SuggestionProviders(BibDatabase database) {
this.database = database;
this.isEmpty = true;
}

public SuggestionProviders() {
this.isEmpty = true;
}

public SuggestionProvider<?> getForField(Field field) {
if (isEmpty || !autoCompletePreferences.getCompleteFields().contains(field)) {
Set<FieldProperty> fieldProperties = field.getProperties();
if (fieldProperties.contains(FieldProperty.SINGLE_ENTRY_LINK)) {
return new BibEntrySuggestionProvider(database);
}
return new EmptySuggestionProvider();
}
// if (isEmpty || !autoCompletePreferences.getCompleteFields().contains(field)) {
pal-anish marked this conversation as resolved.
Show resolved Hide resolved
// return new EmptySuggestionProvider();
// }

Set<FieldProperty> fieldProperties = field.getProperties();
if (fieldProperties.contains(FieldProperty.PERSON_NAMES)) {
Expand Down
Loading