Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fileURlfix
Browse files Browse the repository at this point in the history
* upstream/master:
  Revised README.md (#4974)
  Switch Jsoup's StringUtil for JabRef's StringUtil (#4970)
  Remove UI ThreadList for maintable as it prevents sorting in maintable (#4964)
  fix map collision (#4962)
  • Loading branch information
Siedlerchr committed May 17, 2019
2 parents d3ce2e2 + 89d0f30 commit 888aa6f
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 25 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ An explanation of donation possibilities and usage of donations is available at

> Not a programmer? [Learn how to help.](http://contribute.jabref.org)
Want to be part of a free and open-source project that tens of thousands scientist use every day?
Check out our [issue tracker](https://github.com/JabRef/jabref/issues) to find something to work on.
You are also welcome to contribute new features.
To get your code included into JabRef, just fork JabRef and create a pull request.
For details have a look at our [guidelines for contributing](CONTRIBUTING.md).
Want to be part of a free and open-source project that tens of thousands scientist use every day? Check out the ways you can contribute, below:
- For details on how to contribute, have a look at our [guidelines for contributing](CONTRIBUTING.md).
- You are welcome to contribute new features. To get your code included into JabRef, just [fork](https://help.github.com/en/articles/fork-a-repo) the JabRef repository, make your changes, and create a [pull request](https://help.github.com/en/articles/about-pull-requests).
- To work on existing JabRef issues, check out our [issue tracker](https://github.com/JabRef/jabref/issues). New to open source contributing? Look for issues with the ["good first issue"](https://github.com/JabRef/jabref/labels/good%20first%20issue) label to get started.

We view pull requests as a collaborative process.
Submit a pull request early to get feedback from the team on work in progress.
We will discuss improvements with you and agree to merge them once the [developers](https://github.com/JabRef/jabref/blob/master/DEVELOPERS) approve.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ dependencies {
// Cannot be updated to 9.*.* until Jabref works with Java 9
compile 'org.controlsfx:controlsfx:8.40.15-SNAPSHOT'

compile 'org.jsoup:jsoup:1.11.3'
compile 'org.jsoup:jsoup:1.12.1'
compile 'com.mashape.unirest:unirest-java:1.4.9'

// >1.8.0-beta is required for java 9 compatibility
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ public void execute() {
}
}

Task<Map<Optional<URL>, BibEntry>> findFullTextsTask = new Task<Map<Optional<URL>, BibEntry>>() {
Task<Map<BibEntry, Optional<URL>>> findFullTextsTask = new Task<Map<BibEntry, Optional<URL>>>() {
@Override
protected Map<Optional<URL>, BibEntry> call() {
Map<Optional<URL>, BibEntry> downloads = new ConcurrentHashMap<>();
protected Map<BibEntry, Optional<URL>> call() {
Map<BibEntry, Optional<URL>> downloads = new ConcurrentHashMap<>();
int count = 0;
for (BibEntry entry : basePanel.getSelectedEntries()) {
FulltextFetchers fetchers = new FulltextFetchers(Globals.prefs.getImportFormatPreferences());
downloads.put(fetchers.findFullTextPDF(entry), entry);
downloads.put(entry, fetchers.findFullTextPDF(entry));
updateProgress(++count, basePanel.getSelectedEntries().size());
}
return downloads;
Expand All @@ -93,10 +93,10 @@ protected Map<Optional<URL>, BibEntry> call() {
Globals.TASK_EXECUTOR.execute(findFullTextsTask);
}

private void downloadFullTexts(Map<Optional<URL>, BibEntry> downloads) {
for (Map.Entry<Optional<URL>, BibEntry> download : downloads.entrySet()) {
BibEntry entry = download.getValue();
Optional<URL> result = download.getKey();
private void downloadFullTexts(Map<BibEntry, Optional<URL>> downloads) {
for (Map.Entry<BibEntry, Optional<URL>> download : downloads.entrySet()) {
BibEntry entry = download.getKey();
Optional<URL> result = download.getValue();
if (result.isPresent()) {
Optional<Path> dir = basePanel.getBibDatabaseContext().getFirstExistingFileDir(Globals.prefs.getFilePreferences());

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableInsertEntry;
import org.jabref.gui.util.BindingsHelper;
import org.jabref.gui.util.CustomLocalDragboard;
import org.jabref.gui.util.ViewModelTableRowFactory;
import org.jabref.logic.l10n.Localization;
Expand Down Expand Up @@ -109,7 +108,7 @@ public MainTable(MainTableDataModel model, JabRefFrame frame,
}
this.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE);

this.setItems(BindingsHelper.forUI(model.getEntriesFilteredAndSorted()));
this.setItems(model.getEntriesFilteredAndSorted());
// Enable sorting
model.getEntriesFilteredAndSorted().comparatorProperty().bind(this.comparatorProperty());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ public class MainTableDataModel {
private final SortedList<BibEntryTableViewModel> entriesSorted;

public MainTableDataModel(BibDatabaseContext context) {
ObservableList<BibEntry> allEntries = context.getDatabase().getEntries();

ObservableList<BibEntry> allEntries = BindingsHelper.forUI(context.getDatabase().getEntries());
ObservableList<BibEntryTableViewModel> entriesViewModel = BindingsHelper.mapBacked(allEntries, BibEntryTableViewModel::new);

entriesFiltered = new FilteredList<>(entriesViewModel);
entriesFiltered.predicateProperty().bind(
Bindings.createObjectBinding(() -> this::isMatched,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.jabref.logic.net.URLDownload;
import org.jabref.model.cleanup.Formatter;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.strings.StringUtil;

import org.jsoup.helper.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import org.jabref.logic.net.URLDownload;
import org.jabref.model.cleanup.Formatter;
import org.jabref.model.entry.BibEntry;

import org.jsoup.helper.StringUtil;
import org.jabref.model.strings.StringUtil;

/**
* Provides a convenient interface for search-based fetcher, which follow the usual three-step procedure:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import org.jabref.model.cleanup.FieldFormatterCleanup;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.FieldName;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.DummyFileUpdateMonitor;

import org.apache.http.client.utils.URIBuilder;
import org.jsoup.helper.StringUtil;

/**
* Fetches data from the SAO/NASA Astrophysics Data System (http://www.adsabs.harvard.edu/)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.FieldName;
import org.jabref.model.strings.StringUtil;
import org.jabref.model.util.OptionalUtil;

import org.jsoup.helper.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
import org.jabref.logic.importer.ImportFormatPreferences;
import org.jabref.logic.importer.ParseException;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.strings.StringUtil;

import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;
import com.mashape.unirest.http.exceptions.UnirestException;
import org.jsoup.helper.StringUtil;

/**
* Fetcher for ISBN using https://bibtex.chimbori.com/, which in turn uses Amazon's API.
Expand Down

0 comments on commit 888aa6f

Please sign in to comment.