Skip to content

Commit

Permalink
Merge branch 'master' into batch_DBMSProcessor_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
abepolk committed Jan 2, 2020
2 parents 8cf40b4 + fab4bdc commit 931ccad
Show file tree
Hide file tree
Showing 158 changed files with 20,743 additions and 6,763 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/cleanup_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ on:
types: [closed]

jobs:
build:

cleanup:
runs-on: ubuntu-latest

steps:
- name: Extract branch name
id: extract_branch
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "##[set-output name=branch;]$(echo ${{ github.event.pull_request.head.ref }})"
- name: Delete folder on builds.jabref.org
uses: appleboy/[email protected]
with:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/refresh-csl-subtrees.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Refresh Citation Style Language Files

on:
push:
paths:
- '.github/workflows/refresh-csl-subtrees.yml'
- 'src/main/resources/csl-locales/**'
schedule:
# run on 1st and 15th of each month
- cron: '1 2 1,15 * *'
Expand All @@ -11,28 +15,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2-beta
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0
- name: Add csl-styles remote
run: git remote add -f csl-styles https://github.com/citation-style-language/styles.git
- name: Update csl-styles
run: |
run: |
git checkout master
git config --local core.editor /usr/bin/cat
git config user.name "github actions"
git config user.email "[email protected]"
git subtree pull --prefix src/main/resources/csl-styles csl-styles master --squash
- name: Add csl-locales remote
run: git remote add -f csl-locales https://github.com/citation-style-language/locales.git
- name: Update csl-locales
run: |
git checkout master
git subtree pull --prefix src/main/resources/csl-locales csl-locales master --squash
- uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master
- name: Report issues
if: failure()
uses: JasonEtco/create-an-issue@master
env:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
filename: .github/failure-csl-update.md
2 changes: 2 additions & 0 deletions .github/workflows/tests-oracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Oracle Tests

on:
push:
branches:
- master
paths:
- 'src/test/java/org/jabref/model/database/**'
- 'src/test/java/org/jabref/logic/shared/**'
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Tests

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
# always run on pull requests

jobs:
checkstyle:
Expand Down
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ Jong-Ho Shinn
Jorge Tornero
josephshin93
Joshua Ramon Enslin
José Jesús Sinohui Fernández
Julian Pfeifer
Jure Slak
József Pallagi
Expand Down Expand Up @@ -182,6 +183,7 @@ Ling Wang
Linus Dietz
Lorenzo Genta
Luciana de Melo e Abud
Luis Romero
Mairieli Wessel
Malik Atalla
Malte Deiseroth
Expand All @@ -196,6 +198,7 @@ Martin Stolle
Martina Catizone
Mathias Walter
Matthias Geiger
Matthias Mueller
Mattia Bunel
Mattias Ulbrich
mcmoody
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the Medline fetcher was only working when JabRef was running from source [#5645](https://github.com/JabRef/jabref/issues/5645)
- We fixed some visual issues in the dark theme [#5764](https://github.com/JabRef/jabref/pull/5764) [#5753](https://github.com/JabRef/jabref/issues/5753)
- We fixed an issue where non-default previews didn't handle unicode characters. [#5779](https://github.com/JabRef/jabref/issues/5779)
- We fixed an issue where the ampersand character wasn't rendering correctly on previews.[#3840](https://github.com/JabRef/jabref/issues/3840)


### Removed
Expand Down
14 changes: 8 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ dependencies {
// Include all jar-files in the 'lib' folder as dependencies
compile fileTree(dir: 'lib', includes: ['*.jar'])

compile 'org.apache.pdfbox:pdfbox:2.0.17'
compile 'org.apache.pdfbox:fontbox:2.0.17'
compile 'org.apache.pdfbox:xmpbox:2.0.17'
compile 'org.apache.pdfbox:pdfbox:2.0.18'
compile 'org.apache.pdfbox:fontbox:2.0.18'
compile 'org.apache.pdfbox:xmpbox:2.0.18'

compile group: 'org.apache.commons', name: 'commons-csv', version: '1.7'

Expand Down Expand Up @@ -149,7 +149,7 @@ dependencies {
exclude module: 'oraclepki'
}

compile ('com.google.guava:guava:28.1-jre') {
compile ('com.google.guava:guava:28.2-jre') {
// TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed
exclude module: "jsr305"
}
Expand Down Expand Up @@ -225,7 +225,7 @@ dependencies {
testCompile "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT"
testCompile "org.hamcrest:hamcrest-library:2.2"

checkstyle 'com.puppycrawl.tools:checkstyle:8.27'
checkstyle 'com.puppycrawl.tools:checkstyle:8.28'
xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2'
jython 'org.python:jython-standalone:2.7.1'
}
Expand Down Expand Up @@ -255,7 +255,9 @@ dependencyUpdates.resolutionStrategy = {
}
}
rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection ->
if (selection.candidate.version ==~ /2.0.26-9.1.1/ || selection.candidate.version ==~ /2.0.26-9.1.2/) {
if (selection.candidate.version ==~ /2.0.26-9.1.2/
|| selection.candidate.version ==~ /2.0.26-9.1.1/
|| selection.candidate.version ==~ /2.0.26-9.1.0/) {
selection.reject('1.7.22-11 is actually newer (strange version system)')
}
}
Expand Down
3 changes: 0 additions & 3 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@
<!-- Checks for Javadoc comments: https://checkstyle.org/config_javadoc.html -->
<module name="InvalidJavadocPosition"/>
<module name="JavadocMethod">
<property name="allowUndeclaredRTE" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="validateThrows" value="true"/>
</module>

<!-- Checks for imports: https://checkstyle.org/config_import.html -->
Expand Down
59 changes: 34 additions & 25 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableFieldChange;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.gui.undo.UndoableRemoveEntries;
import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.gui.worker.SendAsEMailAction;
Expand All @@ -80,8 +80,8 @@
import org.jabref.model.database.KeyCollisionException;
import org.jabref.model.database.event.BibDatabaseContextChangedEvent;
import org.jabref.model.database.event.CoarseChangeFilter;
import org.jabref.model.database.event.EntriesAddedEvent;
import org.jabref.model.database.event.EntriesRemovedEvent;
import org.jabref.model.database.event.EntryAddedEvent;
import org.jabref.model.database.shared.DatabaseLocation;
import org.jabref.model.database.shared.DatabaseSynchronizer;
import org.jabref.model.entry.BibEntry;
Expand Down Expand Up @@ -168,7 +168,7 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas
setupActions();

this.getDatabase().registerListener(new SearchListener());
this.getDatabase().registerListener(new EntryRemovedListener());
this.getDatabase().registerListener(new EntriesRemovedListener());

// ensure that at each addition of a new entry, the entry is added to the groups interface
this.bibDatabaseContext.getDatabase().registerListener(new GroupTreeListener());
Expand Down Expand Up @@ -605,29 +605,39 @@ public void registerUndoableChanges(List<FieldChange> changes) {
}
}

public void insertEntry(final BibEntry bibEntry) {
if (bibEntry != null) {
insertEntries(Collections.singletonList(bibEntry));
}
}

/**
* This method is called from JabRefFrame when the user wants to create a new entry.
* This method is called from JabRefFrame when the user wants to create a new entry or entries.
* It is necessary when the user would expect the added entry or one of the added entries
* to be selected in the entry editor
*
* @param bibEntry The new entry.
* @param entries The new entries.
*/
public void insertEntry(final BibEntry bibEntry) {
if (bibEntry != null) {

public void insertEntries(final List<BibEntry> entries) {
if (!entries.isEmpty()) {
try {
bibDatabaseContext.getDatabase().insertEntry(bibEntry);
bibDatabaseContext.getDatabase().insertEntries(entries);

// Set owner and timestamp
UpdateField.setAutomaticFields(bibEntry, true, true, Globals.prefs.getUpdateFieldPreferences());

// Create an UndoableInsertEntry object.
getUndoManager().addEdit(new UndoableInsertEntry(bibDatabaseContext.getDatabase(), bibEntry));
for (BibEntry entry : entries) {
UpdateField.setAutomaticFields(entry, true, true, Globals.prefs.getUpdateFieldPreferences());
}
// Create an UndoableInsertEntries object.
getUndoManager().addEdit(new UndoableInsertEntries(bibDatabaseContext.getDatabase(), entries));

markBaseChanged(); // The database just changed.
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_OPEN_FORM)) {
showAndEdit(bibEntry);
showAndEdit(entries.get(0));
}
clearAndSelect(bibEntry);
clearAndSelect(entries.get(0));
} catch (KeyCollisionException ex) {
LOGGER.info("Collision for bibtex key" + bibEntry.getId(), ex);
LOGGER.info("Collision for bibtex key" + ex.getId(), ex);
}
}
}
Expand Down Expand Up @@ -1111,22 +1121,21 @@ public void searchAndOpen() {
private class GroupTreeListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
// if the added entry is an undo don't add it to the current group
if (addedEntryEvent.getEntriesEventSource() == EntriesEventSource.UNDO) {
public void listen(EntriesAddedEvent addedEntriesEvent) {
// if the event is an undo, don't add it to the current group
if (addedEntriesEvent.getEntriesEventSource() == EntriesEventSource.UNDO) {
return;
}

// Automatically add new entry to the selected group (or set of groups)
// Automatically add new entries to the selected group (or set of groups)
if (Globals.prefs.getBoolean(JabRefPreferences.AUTO_ASSIGN_GROUP)) {
final List<BibEntry> entries = Collections.singletonList(addedEntryEvent.getBibEntry());
Globals.stateManager.getSelectedGroup(bibDatabaseContext).forEach(
selectedGroup -> selectedGroup.addEntriesToGroup(entries));
selectedGroup -> selectedGroup.addEntriesToGroup(addedEntriesEvent.getBibEntries()));
}
}
}

private class EntryRemovedListener {
private class EntriesRemovedListener {

@Subscribe
public void listen(EntriesRemovedEvent entriesRemovedEvent) {
Expand All @@ -1141,8 +1150,8 @@ public void listen(EntriesRemovedEvent entriesRemovedEvent) {
private class SearchAutoCompleteListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(addedEntryEvent.getBibEntry()));
public void listen(EntriesAddedEvent addedEntriesEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> addedEntriesEvent.getBibEntries().forEach(entry -> searchAutoCompleter.indexEntry(entry)));
}

@Subscribe
Expand All @@ -1158,7 +1167,7 @@ public void listen(EntryChangedEvent entryChangedEvent) {
private class SearchListener {

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
public void listen(EntriesAddedEvent addedEntryEvent) {
DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package org.jabref.gui.autocompleter;

import org.jabref.model.database.event.EntryAddedEvent;
import java.util.List;

import org.jabref.model.database.event.EntriesAddedEvent;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.event.EntryChangedEvent;

import com.google.common.eventbus.Subscribe;
Expand All @@ -17,8 +20,11 @@ public AutoCompleteUpdater(SuggestionProviders suggestionProviders) {
}

@Subscribe
public void listen(EntryAddedEvent addedEntryEvent) {
suggestionProviders.indexEntry(addedEntryEvent.getBibEntry());
public void listen(EntriesAddedEvent entryAddedEvent) {
List<BibEntry> entries = entryAddedEvent.getBibEntries();
for (BibEntry entry : entries) {
suggestionProviders.indexEntry(entry);
}
}

@Subscribe
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.jabref.JabRefGUI;
import org.jabref.gui.preview.PreviewViewer;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
Expand All @@ -26,7 +26,7 @@ public EntryAddChangeViewModel(BibEntry entry) {
@Override
public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) {
database.getDatabase().insertEntry(entry);
undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), entry));
undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), entry));
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/gui/collab/EntryChangeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.jabref.gui.mergeentries.MergeEntries;
import org.jabref.gui.mergeentries.MergeEntries.DefaultRadioButtonSelectionMode;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.entry.BibEntry;
Expand Down Expand Up @@ -43,8 +43,8 @@ public EntryChangeViewModel(BibEntry entry, BibEntry newEntry, BibDatabaseContex
public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) {
database.getDatabase().removeEntry(oldEntry);
database.getDatabase().insertEntry(mergePanel.getMergeEntry());
undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), oldEntry));
undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), mergePanel.getMergeEntry()));
undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), oldEntry));
undoEdit.addEdit(new UndoableInsertEntries(database.getDatabase(), mergePanel.getMergeEntry()));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverResult;
import org.jabref.gui.duplicationFinder.DuplicateResolverDialog.DuplicateResolverType;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.undo.UndoableInsertEntries;
import org.jabref.gui.undo.UndoableRemoveEntries;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.DefaultTaskExecutor;
Expand Down Expand Up @@ -167,10 +167,8 @@ private void handleDuplicates(DuplicateSearchResult result) {
}
// and adding merged entries:
if (!result.getToAdd().isEmpty()) {
for (BibEntry entry : result.getToAdd()) {
panel.getDatabase().insertEntry(entry);
compoundEdit.addEdit(new UndoableInsertEntry(panel.getDatabase(), entry));
}
compoundEdit.addEdit(new UndoableInsertEntries(panel.getDatabase(), result.getToAdd()));
panel.getDatabase().insertEntries(result.getToAdd());
panel.markBaseChanged();
}

Expand Down
Loading

0 comments on commit 931ccad

Please sign in to comment.