Navigation Menu

Skip to content

Commit

Permalink
extension
Browse files Browse the repository at this point in the history
  • Loading branch information
systemoperator committed Feb 13, 2020
1 parent 75132ea commit 6d03ac8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/actions/StandardActions.java
Expand Up @@ -132,7 +132,7 @@ public enum StandardActions implements Action {
FIND_UNLINKED_FILES(Localization.lang("Search for unlinked local files"), IconTheme.JabRefIcons.SEARCH, KeyBinding.FIND_UNLINKED_FILES),
AUTO_LINK_FILES(Localization.lang("Automatically set file links"), IconTheme.JabRefIcons.AUTO_FILE_LINK, KeyBinding.AUTOMATICALLY_LINK_FILES),
LOOKUP_DOC_IDENTIFIER(Localization.lang("Search document identifier online")),
FETCH_CITATION_COUNTS(Localization.lang("Fetch citation counts online")),
FETCH_CITATION_COUNTS(Localization.lang("Fetch citation counts online"), IconTheme.JabRefIcons.DOWNLOAD, KeyBinding.COPY_BIBTEX_KEY.FETCH_CITATION_COUNTS),
LOOKUP_FULLTEXT(Localization.lang("Search full text documents online"), IconTheme.JabRefIcons.FILE_SEARCH, KeyBinding.DOWNLOAD_FULL_TEXT),
GENERATE_CITE_KEY(Localization.lang("Generate BibTeX key"), IconTheme.JabRefIcons.MAKE_KEY, KeyBinding.AUTOGENERATE_BIBTEX_KEYS),
GENERATE_CITE_KEYS(Localization.lang("Generate BibTeX keys"), IconTheme.JabRefIcons.MAKE_KEY, KeyBinding.AUTOGENERATE_BIBTEX_KEYS),
Expand Down
Expand Up @@ -5,6 +5,7 @@

import javax.swing.undo.UndoManager;

import javafx.collections.ObservableList;
import javafx.concurrent.Task;

import org.jabref.gui.DialogService;
Expand Down Expand Up @@ -54,7 +55,7 @@ public FetchCitationCounts(JabRefFrame frame, JabRefPreferences preferences, Sta
@Override
public void execute() {
BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null"));
List<BibEntry> entries = stateManager.getSelectedEntries();
ObservableList<BibEntry> entries = stateManager.getSelectedEntries();

final NamedCompound nc = new NamedCompound(Localization.lang("Fetch citation counts"));

Expand All @@ -74,11 +75,20 @@ protected List<BibEntry> call() {
String creatorsType = "";

creatorsString = entry.getField(StandardField.AUTHOR).orElse("").trim();
creatorsType = "author";

if (creatorsString.length() == 0) {
if (creatorsString.length() != 0) {
creatorsType = "author";
}
else {
creatorsString = entry.getField(StandardField.EDITOR).orElse("").trim();
creatorsType = "editor";

if (creatorsString.length() != 0) {
creatorsType = "editor";
}
else
{
creatorsType = "";
}
}

AuthorList authorList = AuthorList.parse(creatorsString);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/org/jabref/gui/keyboard/KeyBinding.java
Expand Up @@ -27,6 +27,7 @@ public enum KeyBinding {
DELETE_ENTRY("Delete entry", Localization.lang("Delete entry"), "DELETE", KeyBindingCategory.BIBTEX),
DEFAULT_DIALOG_ACTION("Execute default action in dialog", Localization.lang("Execute default action in dialog"), "ctrl+ENTER", KeyBindingCategory.VIEW),
DOWNLOAD_FULL_TEXT("Download full text documents", Localization.lang("Download full text documents"), "alt+F7", KeyBindingCategory.QUALITY),
FETCH_CITATION_COUNTS("Fetch citation counts online", Localization.lang("Fetch citation counts online"), "ctrl+alt+C", KeyBindingCategory.TOOLS),
EDIT_ENTRY("Edit entry", Localization.lang("Edit entry"), "ctrl+E", KeyBindingCategory.BIBTEX),
EXPORT("Export", Localization.lang("Export"), "ctrl+alt+e", KeyBindingCategory.FILE),
EXPORT_SELECTED("Export Selected", Localization.lang("Export selected entries"), "ctrl+shift+e", KeyBindingCategory.FILE),
Expand Down

0 comments on commit 6d03ac8

Please sign in to comment.