From 6dec1747d8a1c89f6c62fc1d1939d88411f17eba Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 8 Sep 2020 15:34:34 +0200 Subject: [PATCH] Complete rebranding of `bibtexkey` as `citationkey` (#6875) --- CHANGELOG.md | 2 + .../high-level-documentation.md | 2 +- .../org/jabref/benchmarks/Benchmarks.java | 2 +- .../BibEntrySuggestionProvider.java | 6 +- .../GenerateCitationKeyAction.java | 13 +- .../GenerateCitationKeySingleAction.java | 2 +- .../gui/collab/EntryAddChangeViewModel.java | 2 +- .../gui/collab/EntryChangeViewModel.java | 2 +- .../collab/EntryDeleteChangeViewModel.java | 2 +- .../CustomEntryTypeDialogViewModel.java | 2 +- .../org/jabref/gui/edit/CopyMoreAction.java | 16 +-- .../LatexCitationsTabViewModel.java | 2 +- .../org/jabref/gui/entryeditor/SourceTab.java | 4 +- .../jabref/gui/exporter/WriteXMPAction.java | 2 +- .../externalfiles/DownloadFullTextAction.java | 8 +- .../gui/externalfiles/ImportHandler.java | 2 +- .../gui/fieldeditors/CitationKeyEditor.fxml | 2 +- .../gui/fieldeditors/CitationKeyEditor.java | 8 +- .../gui/fieldeditors/LinkedFileViewModel.java | 2 +- ...geReviewIntoCommentConfirmationDialog.java | 2 +- .../gui/integrity/IntegrityCheckDialog.java | 2 +- .../org/jabref/gui/openoffice/OOBibBase.java | 43 +++--- .../gui/openoffice/OpenOfficePanel.java | 4 +- .../org/jabref/gui/preview/PreviewViewer.java | 6 +- .../gui/push/PushToApplicationAction.java | 4 +- .../texparser/ParseLatexResultViewModel.java | 2 +- .../jabref/gui/undo/UndoableChangeType.java | 2 +- .../jabref/gui/undo/UndoableFieldChange.java | 2 +- .../gui/undo/UndoableInsertEntries.java | 4 +- .../jabref/gui/undo/UndoableKeyChange.java | 4 +- .../gui/undo/UndoableRemoveEntries.java | 4 +- .../logic/auxparser/DefaultAuxParser.java | 8 +- .../jabref/logic/bibtex/BibEntryWriter.java | 4 +- src/main/java/org/jabref/logic/bst/VM.java | 2 +- .../CitationKeyGenerator.java | 10 +- .../logic/citationstyle/CSLAdapter.java | 6 +- .../logic/exporter/BibDatabaseWriter.java | 2 +- .../logic/exporter/BibTeXMLExporter.java | 2 +- .../jabref/logic/exporter/ModsExporter.java | 2 +- .../jabref/logic/exporter/XmpExporter.java | 2 +- .../java/org/jabref/logic/help/HelpFile.java | 2 +- .../importer/fileformat/BibTeXMLImporter.java | 2 +- .../importer/fileformat/BibtexParser.java | 6 +- .../importer/fileformat/ModsImporter.java | 6 +- .../logic/integrity/CitationKeyChecker.java | 2 +- .../CitationKeyDeviationChecker.java | 2 +- .../CitationKeyDuplicationChecker.java | 4 +- .../logic/integrity/EntryLinkChecker.java | 4 +- .../logic/integrity/IntegrityMessage.java | 2 +- .../jabref/logic/pdf/FileAnnotationCache.java | 4 +- .../texparser/TexBibEntriesResolver.java | 4 +- .../java/org/jabref/logic/util/TestEntry.java | 4 +- .../util/io/CitationKeyBasedFileFinder.java | 2 +- .../org/jabref/logic/util/io/FileUtil.java | 2 +- .../jabref/logic/xmp/DublinCoreExtractor.java | 2 +- .../ConvertLegacyExplicitGroups.java | 2 +- .../migrations/PreferencesMigrations.java | 8 +- .../java/org/jabref/model/FieldChange.java | 2 +- .../jabref/model/database/BibDatabase.java | 27 ++-- .../model/database/KeyChangeListener.java | 2 +- .../java/org/jabref/model/entry/BibEntry.java | 36 ++--- .../jabref/model/entry/CanonicalBibEntry.java | 4 +- .../jabref/model/entry/ParsedEntryLink.java | 6 +- .../model/entry/field/FieldFactory.java | 4 +- .../model/entry/field/InternalField.java | 7 +- .../org/jabref/model/groups/TexGroup.java | 2 +- .../model/texparser/LatexParserResult.java | 2 +- .../jabref/preferences/JabRefPreferences.java | 8 +- .../resources/resource/layout/docbook4.layout | 2 +- .../layout/docbook4.mastersthesis.layout | 2 +- .../resource/layout/docbook5.article.layout | 2 +- .../resource/layout/docbook5.book.layout | 10 +- .../resource/layout/docbook5.booklet.layout | 2 +- .../layout/docbook5.collection.layout | 2 +- .../resource/layout/docbook5.inbook.layout | 2 +- .../layout/docbook5.incollection.layout | 2 +- .../resources/resource/layout/docbook5.layout | 6 +- .../resource/layout/docbook5.phdthesis.layout | 4 +- .../resource/layout/docbook5.www.layout | 4 +- .../layout/endnote/EndNote.article.layout | 16 +-- .../layout/endnote/EndNote.book.layout | 12 +- .../layout/endnote/EndNote.booklet.layout | 14 +- .../layout/endnote/EndNote.inbook.layout | 10 +- .../endnote/EndNote.incollection.layout | 10 +- .../endnote/EndNote.inproceedings.layout | 10 +- .../resource/layout/endnote/EndNote.layout | 20 +-- .../layout/endnote/EndNote.manual.layout | 18 +-- .../endnote/EndNote.mastersthesis.layout | 22 +-- .../layout/endnote/EndNote.misc.layout | 20 +-- .../layout/endnote/EndNote.other.layout | 20 +-- .../layout/endnote/EndNote.phdthesis.layout | 22 +-- .../layout/endnote/EndNote.proceedings.layout | 10 +- .../layout/endnote/EndNote.techreport.layout | 20 +-- .../layout/endnote/EndNote.unpublished.layout | 20 +-- .../resource/layout/html.book.layout | 2 +- .../resource/layout/html.inbook.layout | 2 +- .../resource/layout/html.inproceedings.layout | 2 +- .../resources/resource/layout/html.layout | 2 +- .../resource/layout/html.mastersthesis.layout | 2 +- .../resource/layout/html.phdthesis.layout | 2 +- .../resource/layout/listrefs/listrefs.layout | 12 +- .../layout/listrefs/listrefs.misc.layout | 12 +- .../layout/openoffice/openoffice-csv.layout | 2 +- .../resource/layout/simplehtml.layout | 2 +- .../layout/tablerefs/tablerefs.layout | 2 +- .../tablerefsabsbib/tablerefsabsbib.layout | 12 +- .../resources/resource/layout/text.layout | 2 +- .../BibEntrySuggestionProviderTest.java | 16 +-- .../AutoSetFileLinksUtilTest.java | 2 +- .../fieldeditors/LinkedFileViewModelTest.java | 10 +- .../logic/bibtex/BibEntryWriterTest.java | 4 +- .../java/org/jabref/logic/bst/TestVM.java | 8 +- .../BracketedPatternTest.java | 20 ++- .../CitationKeyGeneratorTest.java | 20 +-- .../MakeLabelWithDatabaseTest.java | 106 +++++++------- .../logic/cleanup/CleanupWorkerTest.java | 4 +- .../logic/cleanup/MoveFilesCleanupTest.java | 2 +- .../logic/cleanup/RenamePdfCleanupTest.java | 10 +- .../logic/database/DuplicateCheckTest.java | 4 +- .../exporter/BibtexDatabaseWriterTest.java | 2 +- .../logic/exporter/DocBook5ExporterTest.java | 2 +- .../exporter/FieldFormatterCleanupsTest.java | 2 +- .../logic/exporter/HtmlExportFormatTest.java | 2 +- .../logic/exporter/XmpExporterTest.java | 8 +- .../importer/DatabaseFileLookupTest.java | 4 +- .../logic/importer/OpenDatabaseTest.java | 8 +- .../fetcher/ACMPortalFetcherTest.java | 2 +- .../fetcher/AstrophysicsDataSystemTest.java | 12 +- ...puterScienceBibliographiesFetcherTest.java | 8 +- .../importer/fetcher/DBLPFetcherTest.java | 2 +- .../logic/importer/fetcher/DiVATest.java | 2 +- .../importer/fetcher/DoiFetcherTest.java | 4 +- .../importer/fetcher/GoogleScholarTest.java | 2 +- .../fetcher/GrobidCitationFetcherTest.java | 50 +++---- .../importer/fetcher/INSPIREFetcherTest.java | 4 +- .../fetcher/IacrEprintFetcherTest.java | 6 +- .../importer/fetcher/IsbnFetcherTest.java | 2 +- .../fetcher/IsbnViaEbookDeFetcherTest.java | 4 +- .../fetcher/IsbnViaOttoBibFetcherTest.java | 6 +- .../importer/fetcher/MathSciNetTest.java | 2 +- .../importer/fetcher/MrDLibFetcherTest.java | 2 +- .../importer/fetcher/RfcFetcherTest.java | 2 +- .../importer/fetcher/TitleFetcherTest.java | 2 +- .../logic/importer/fetcher/ZbMATHTest.java | 2 +- .../fileformat/BibtexImporterTest.java | 16 +-- .../importer/fileformat/BibtexParserTest.java | 112 +++++++-------- .../fileformat/EndnoteImporterTest.java | 2 +- .../logic/integrity/EntryLinkCheckerTest.java | 10 +- .../jabref/logic/layout/LayoutEntryTest.java | 2 +- .../logic/shared/DBMSProcessorTest.java | 134 +++++++++--------- .../shared/SynchronizationTestSimulator.java | 2 +- .../logic/texparser/LatexParserTest.java | 20 +-- .../texparser/TexBibEntriesResolverTest.java | 14 +- .../io/CitationKeyBasedFileFinderTest.java | 2 +- .../jabref/logic/util/io/FileUtilTest.java | 33 ++--- .../util/io/RegExpBasedFileFinderTests.java | 32 ++--- .../jabref/logic/xmp/XmpUtilWriterTest.java | 6 +- .../ConvertLegacyExplicitGroupsTest.java | 2 +- ...eReviewIntoCommentActionMigrationTest.java | 12 +- .../migrations/PreferencesMigrationsTest.java | 26 ++-- .../model/database/BibDatabaseTest.java | 16 +-- .../database/DuplicationCheckerTest.java | 60 ++++---- .../model/database/KeyChangeListenerTest.java | 14 +- .../org/jabref/model/entry/BibEntryTest.java | 32 ++--- .../model/entry/CanonicalBibEntryTest.java | 4 +- .../org/jabref/model/entry/CrossrefTest.java | 2 +- .../jabref/model/entry/EntryLinkListTest.java | 4 +- .../org/jabref/model/groups/TexGroupTest.java | 4 +- .../rules/ContainBasedSearchRuleTest.java | 2 +- .../exporter/BibTeXMLExporterTestInBook.xml | 2 +- .../BibTeXMLExporterTestInbookLessFields.xml | 2 +- .../BibTeXMLExporterTestInvalidInbook.xml | 2 +- src/test/resources/testbib/complex.bib | 2 +- 173 files changed, 810 insertions(+), 803 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68f92a950df..1bd3ea31bd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We removed two useless preferences in the groups preferences dialog. [#6836](https://github.com/JabRef/jabref/pull/6836) - Synchronization of SpecialFields to keywords is now disabled by default. [#6621](https://github.com/JabRef/jabref/issues/6621) - JabRef no longer opens the entry editor with the first entry on startup [#6855](https://github.com/JabRef/jabref/issues/6855) +- We completed the rebranding of `bibtexkey` as `citationkey` which was started in JabRef 5.1. +- JabRef no longer opens the entry editor with the first entry on startup [#6855](https://github.com/JabRef/jabref/issues/6855) - Fetch by ID: (long) "SAO/NASA Astrophysics Data System" replaced by (short) "SAO/NASA ADS" [#6876](https://github.com/JabRef/jabref/pull/6876) ### Fixed diff --git a/docs/getting-into-the-code/high-level-documentation.md b/docs/getting-into-the-code/high-level-documentation.md index eb4d80521db..84e5295ae70 100644 --- a/docs/getting-into-the-code/high-level-documentation.md +++ b/docs/getting-into-the-code/high-level-documentation.md @@ -35,5 +35,5 @@ All packages and classes which are currently not part of these packages \(we are ## Most Important Classes and their Relation -Both GUI and CLI are started via the `JabRefMain` which will in turn call `JabRef` which then decides whether the GUI \(`JabRefFrame`\) or the CLI \(`JabRefCLI` and a lot of code in `JabRef`\) will be started. The `JabRefFrame` represents the Window which contains a `SidePane` on the left used for the fetchers/groups Each tab is a `BasePanel` which has a `SearchBar` at the top, a `MainTable` at the center and a `PreviewPanel` or an `EntryEditor` at the bottom. Any right click on the `MainTable` is handled by the `RightClickMenu`. Each `BasePanel` holds a `BibDatabaseContext` consisting of a `BibDatabase` and the `MetaData`, which are the only relevant data of the currently shown database. A `BibDatabase` has a list of `BibEntries`. Each `BibEntry` has a key, a bibtex key and a key/value store for the fields with their values. Interpreted data \(such as the type or the file field\) is stored in the `TypedBibentry` type. The user can change the `JabRefPreferences` through the `PreferencesDialog`. +Both GUI and CLI are started via the `JabRefMain` which will in turn call `JabRef` which then decides whether the GUI \(`JabRefFrame`\) or the CLI \(`JabRefCLI` and a lot of code in `JabRef`\) will be started. The `JabRefFrame` represents the Window which contains a `SidePane` on the left used for the fetchers/groups Each tab is a `BasePanel` which has a `SearchBar` at the top, a `MainTable` at the center and a `PreviewPanel` or an `EntryEditor` at the bottom. Any right click on the `MainTable` is handled by the `RightClickMenu`. Each `BasePanel` holds a `BibDatabaseContext` consisting of a `BibDatabase` and the `MetaData`, which are the only relevant data of the currently shown database. A `BibDatabase` has a list of `BibEntries`. Each `BibEntry` has an ID, a citation key and a key/value store for the fields with their values. Interpreted data \(such as the type or the file field\) is stored in the `TypedBibentry` type. The user can change the `JabRefPreferences` through the `PreferencesDialog`. diff --git a/src/jmh/java/org/jabref/benchmarks/Benchmarks.java b/src/jmh/java/org/jabref/benchmarks/Benchmarks.java index b1826b20acb..31935438c71 100644 --- a/src/jmh/java/org/jabref/benchmarks/Benchmarks.java +++ b/src/jmh/java/org/jabref/benchmarks/Benchmarks.java @@ -55,7 +55,7 @@ public void init() throws Exception { Random randomizer = new Random(); for (int i = 0; i < 1000; i++) { BibEntry entry = new BibEntry(); - entry.setCiteKey("id" + i); + entry.setCitationKey("id" + i); entry.setField(StandardField.TITLE, "This is my title " + i); entry.setField(StandardField.AUTHOR, "Firstname Lastname and FirstnameA LastnameA and FirstnameB LastnameB" + i); entry.setField(StandardField.JOURNAL, "Journal Title " + i); diff --git a/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java b/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java index 3cf297c71c1..a69b8a3b1c1 100644 --- a/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java +++ b/src/main/java/org/jabref/gui/autocompleter/BibEntrySuggestionProvider.java @@ -13,7 +13,7 @@ import org.controlsfx.control.textfield.AutoCompletionBinding; /** - * Delivers possible completions as a list of {@link BibEntry} based on their cite key. + * Delivers possible completions as a list of {@link BibEntry} based on their citation key. */ public class BibEntrySuggestionProvider extends SuggestionProvider { @@ -25,7 +25,7 @@ public BibEntrySuggestionProvider(BibDatabase database) { @Override protected Equivalence getEquivalence() { - return Equivalence.equals().onResultOf(BibEntry::getCiteKeyOptional); + return Equivalence.equals().onResultOf(BibEntry::getCitationKey); } @Override @@ -36,7 +36,7 @@ protected Comparator getComparator() { @Override protected boolean isMatch(BibEntry entry, AutoCompletionBinding.ISuggestionRequest request) { String userText = request.getUserText(); - return entry.getCiteKeyOptional() + return entry.getCitationKey() .map(key -> StringUtil.containsIgnoreCase(key, userText)) .orElse(false); } diff --git a/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeyAction.java b/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeyAction.java index e7dae493860..4173db5cc65 100644 --- a/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeyAction.java +++ b/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeyAction.java @@ -68,15 +68,14 @@ public static boolean confirmOverwriteKeys(DialogService dialogService) { private void checkOverwriteKeysChosen() { // We don't want to generate keys for entries which already have one thus remove the entries if (Globals.prefs.getBoolean(JabRefPreferences.AVOID_OVERWRITING_KEY)) { - entries.removeIf(BibEntry::hasCiteKey); - // if we're going to override some cite keys warn the user about it - } else if (entries.parallelStream().anyMatch(BibEntry::hasCiteKey)) { + entries.removeIf(BibEntry::hasCitationKey); + // if we're going to override some citation keys warn the user about it + } else if (entries.parallelStream().anyMatch(BibEntry::hasCitationKey)) { boolean overwriteKeys = confirmOverwriteKeys(dialogService); - // The user doesn't want to override cite keys + // The user doesn't want to override citation keys if (!overwriteKeys) { isCanceled = true; - return; } } } @@ -87,7 +86,7 @@ private void generateKeys() { } stateManager.getActiveDatabase().ifPresent(databaseContext -> { - // generate the new cite keys for each entry + // generate the new citation keys for each entry final NamedCompound compound = new NamedCompound(Localization.lang("Autogenerate citation keys")); CitationKeyGenerator keyGenerator = new CitationKeyGenerator(databaseContext, Globals.prefs.getCitationKeyPatternPreferences()); @@ -97,7 +96,7 @@ private void generateKeys() { } compound.end(); - // register the undo event only if new cite keys were generated + // register the undo event only if new citation keys were generated if (compound.hasEdits()) { frame.getUndoManager().addEdit(compound); } diff --git a/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeySingleAction.java b/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeySingleAction.java index 43e2acbe1ef..b66beef36be 100644 --- a/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeySingleAction.java +++ b/src/main/java/org/jabref/gui/citationkeypattern/GenerateCitationKeySingleAction.java @@ -32,7 +32,7 @@ public GenerateCitationKeySingleAction(BibEntry entry, BibDatabaseContext databa @Override public void execute() { - if (!entry.hasCiteKey() || GenerateCitationKeyAction.confirmOverwriteKeys(dialogService)) { + if (!entry.hasCitationKey() || GenerateCitationKeyAction.confirmOverwriteKeys(dialogService)) { new CitationKeyGenerator(databaseContext, preferencesService.getCitationKeyPatternPreferences()) .generateAndSetKey(entry) .ifPresent(change -> undoManager.addEdit(new UndoableKeyChange(change))); diff --git a/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java b/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java index ccd41b1b74d..6e5e0d8b456 100644 --- a/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/EntryAddChangeViewModel.java @@ -17,7 +17,7 @@ class EntryAddChangeViewModel extends DatabaseChangeViewModel { public EntryAddChangeViewModel(BibEntry entry) { super(); - this.name = entry.getCiteKeyOptional() + this.name = entry.getCitationKey() .map(key -> Localization.lang("Added entry") + ": '" + key + '\'') .orElse(Localization.lang("Added entry")); this.entry = entry; diff --git a/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java b/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java index cc303b27178..bbb006da2cc 100644 --- a/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java @@ -25,7 +25,7 @@ public EntryChangeViewModel(BibEntry entry, BibEntry newEntry) { this.oldEntry = entry; this.newEntry = newEntry; - name = entry.getCiteKeyOptional() + name = entry.getCitationKey() .map(key -> Localization.lang("Modified entry") + ": '" + key + '\'') .orElse(Localization.lang("Modified entry")); } diff --git a/src/main/java/org/jabref/gui/collab/EntryDeleteChangeViewModel.java b/src/main/java/org/jabref/gui/collab/EntryDeleteChangeViewModel.java index 5bc4f01fcf5..ff6adfd3fce 100644 --- a/src/main/java/org/jabref/gui/collab/EntryDeleteChangeViewModel.java +++ b/src/main/java/org/jabref/gui/collab/EntryDeleteChangeViewModel.java @@ -22,7 +22,7 @@ class EntryDeleteChangeViewModel extends DatabaseChangeViewModel { public EntryDeleteChangeViewModel(BibEntry entry) { super(Localization.lang("Deleted entry")); - this.name = entry.getCiteKeyOptional() + this.name = entry.getCitationKey() .map(key -> Localization.lang("Deleted entry") + ": '" + key + '\'') .orElse(Localization.lang("Deleted entry")); this.entry = entry; diff --git a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java index 2e91b67a4b7..14addc7ea20 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java +++ b/src/main/java/org/jabref/gui/customentrytypes/CustomEntryTypeDialogViewModel.java @@ -50,7 +50,7 @@ public Field fromString(String string) { } }; - private final ObservableList fieldsForAdding = FXCollections.observableArrayList(FieldFactory.getStandardFielsdsWithBibTexKey()); + private final ObservableList fieldsForAdding = FXCollections.observableArrayList(FieldFactory.getStandardFieldsWithCitationKey()); private final ObjectProperty selectedEntryType = new SimpleObjectProperty<>(); private final ObjectProperty selectedFieldToAdd = new SimpleObjectProperty<>(); private final StringProperty entryTypeToAdd = new SimpleStringProperty(""); diff --git a/src/main/java/org/jabref/gui/edit/CopyMoreAction.java b/src/main/java/org/jabref/gui/edit/CopyMoreAction.java index 0d87538efb9..ac138cf5a85 100644 --- a/src/main/java/org/jabref/gui/edit/CopyMoreAction.java +++ b/src/main/java/org/jabref/gui/edit/CopyMoreAction.java @@ -104,8 +104,8 @@ private void copyKey() { // Collect all non-null keys. List keys = entries.stream() - .filter(entry -> entry.getCiteKeyOptional().isPresent()) - .map(entry -> entry.getCiteKeyOptional().get()) + .filter(entry -> entry.getCitationKey().isPresent()) + .map(entry -> entry.getCitationKey().get()) .collect(Collectors.toList()); if (keys.isEmpty()) { @@ -131,8 +131,8 @@ private void copyCiteKey() { // Collect all non-null keys. List keys = entries.stream() - .filter(entry -> entry.getCiteKeyOptional().isPresent()) - .map(entry -> entry.getCiteKeyOptional().get()) + .filter(entry -> entry.getCitationKey().isPresent()) + .map(entry -> entry.getCitationKey().get()) .collect(Collectors.toList()); if (keys.isEmpty()) { @@ -161,7 +161,7 @@ private void copyKeyAndTitle() { List entries = stateManager.getSelectedEntries(); // ToDo: this string should be configurable to allow arbitrary exports - StringReader layoutString = new StringReader("\\bibtexkey - \\begin{title}\\format[RemoveBrackets]{\\title}\\end{title}\n"); + StringReader layoutString = new StringReader("\\citationkey - \\begin{title}\\format[RemoveBrackets]{\\title}\\end{title}\n"); Layout layout; try { layout = new LayoutHelper(layoutString, preferencesService.getLayoutFormatterPreferences(Globals.journalAbbreviationRepository)).getLayoutFromText(); @@ -175,7 +175,7 @@ private void copyKeyAndTitle() { int entriesWithKeys = 0; // Collect all non-null keys. for (BibEntry entry : entries) { - if (entry.hasCiteKey()) { + if (entry.hasCitationKey()) { entriesWithKeys++; keyAndTitle.append(layout.doLayout(entry, stateManager.getActiveDatabase().get().getDatabase())); } @@ -209,7 +209,7 @@ private void copyKeyAndLink() { StringBuilder keyAndLink = new StringBuilder(); List entriesWithKey = entries.stream() - .filter(BibEntry::hasCiteKey) + .filter(BibEntry::hasCitationKey) .collect(Collectors.toList()); if (entriesWithKey.isEmpty()) { @@ -218,7 +218,7 @@ private void copyKeyAndLink() { } for (BibEntry entry : entriesWithKey) { - String key = entry.getCiteKeyOptional().get(); + String key = entry.getCitationKey().get(); String url = entry.getField(StandardField.URL).orElse(""); keyAndLink.append(url.isEmpty() ? key : String.format("%s", url, key)); keyAndLink.append(OS.NEWLINE); diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 760ad6edf80..03dc9fa06ab 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -76,7 +76,7 @@ public void init(BibEntry entry) { cancelSearch(); currentEntry = entry; - Optional citeKey = entry.getCiteKeyOptional(); + Optional citeKey = entry.getCitationKey(); if (citeKey.isPresent()) { startSearch(citeKey.get()); diff --git a/src/main/java/org/jabref/gui/entryeditor/SourceTab.java b/src/main/java/org/jabref/gui/entryeditor/SourceTab.java index d413eb07bfc..aba1aca5363 100644 --- a/src/main/java/org/jabref/gui/entryeditor/SourceTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/SourceTab.java @@ -278,10 +278,10 @@ private void storeSource(BibEntry outOfFocusEntry, String text) { NamedCompound compound = new NamedCompound(Localization.lang("source edit")); BibEntry newEntry = database.getEntries().get(0); - String newKey = newEntry.getCiteKeyOptional().orElse(null); + String newKey = newEntry.getCitationKey().orElse(null); if (newKey != null) { - outOfFocusEntry.setCiteKey(newKey); + outOfFocusEntry.setCitationKey(newKey); } else { outOfFocusEntry.clearCiteKey(); } diff --git a/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java b/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java index 0ac0918fb09..51570c8fdfa 100644 --- a/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java +++ b/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java @@ -117,7 +117,7 @@ private void writeXMP() { .collect(Collectors.toList()); Platform.runLater(() -> optionsDialog.getProgressArea() - .appendText(entry.getCiteKeyOptional().orElse(Localization.lang("undefined")) + "\n")); + .appendText(entry.getCitationKey().orElse(Localization.lang("undefined")) + "\n")); if (files.isEmpty()) { skipped++; diff --git a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java index 1ec8ca2ee1c..019678e7d84 100644 --- a/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java +++ b/src/main/java/org/jabref/gui/externalfiles/DownloadFullTextAction.java @@ -126,7 +126,7 @@ private void downloadFullTexts(Map> downloads, BibDataba addLinkedFileFromURL(databaseContext, result.get(), entry, dir.get()); } else { dialogService.notify(Localization.lang("No full text document found for entry %0.", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); + entry.getCitationKey().orElse(Localization.lang("undefined")))); } } } @@ -164,11 +164,11 @@ private void addLinkedFileFromURL(BibDatabaseContext databaseContext, URL url, B ExternalFileTypes.getInstance()); entry.addFile(downloadedFile); dialogService.notify(Localization.lang("Finished downloading full text document for entry %0.", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); + entry.getCitationKey().orElse(Localization.lang("undefined")))); }); downloadTask.titleProperty().set(Localization.lang("Downloading")); downloadTask.messageProperty().set( - Localization.lang("Fulltext for") + ": " + entry.getCiteKeyOptional().orElse(Localization.lang("New entry"))); + Localization.lang("Fulltext for") + ": " + entry.getCitationKey().orElse(Localization.lang("New entry"))); downloadTask.showToUser(true); Globals.TASK_EXECUTOR.execute(downloadTask); } catch (MalformedURLException exception) { @@ -176,7 +176,7 @@ private void addLinkedFileFromURL(BibDatabaseContext databaseContext, URL url, B } } else { dialogService.notify(Localization.lang("Full text document for entry %0 already linked.", - entry.getCiteKeyOptional().orElse(Localization.lang("undefined")))); + entry.getCitationKey().orElse(Localization.lang("undefined")))); } } } diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java index ccb21e3b936..dcb570a82cd 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java @@ -117,7 +117,7 @@ public void importEntries(List entries) { preferencesService.getOwnerPreferences(), preferencesService.getTimestampPreferences()); - // Generate bibtex keys + // Generate citation keys generateKeys(entries); // Add to group diff --git a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.fxml b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.fxml index 5e38d8c98ab..fcb4b34414c 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.fxml +++ b/src/main/java/org/jabref/gui/fieldeditors/CitationKeyEditor.fxml @@ -6,5 +6,5 @@ -