Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into editStringsjavafx
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix NPE and not on FX Thread in PreviewPrefs Tabs (#4624)
  Fix preview style configuration (#4613)
  Bump wiremock from 2.20.0 to 2.21.0 (#4623)
  snap: disable tests build, add removable media and specify architectures (#4619)
  Bump checkstyle from 8.16 to 8.17 (#4620)
  Fix preferences path: use _JAVA_OPTIONS
  Try to fix not on FX thread for search and autocomplete (#4618)
  Update snapcraft.yaml Move to snap folder
  Convert DuplicateResolverDialog to javafx (#4601)
  Fix for BibTex source tab parsing issue if field contains {} (#4581)
  Convert OO/LO SidePanel to javafx (#4341)
  Convert "Customize importer" dialog to JavaFX (#4608)
  Convert "From Aux file" dialog to JavaFX (#4607)
  Convert "Show preferences" dialog to JavaFX (#4605)
  Fix not on FX thread exception
  Force javafx to run thread (#4604)
  Convert new version dialog to JavaFX (#4602)
  Add a variable to track the change in preview style (#4587)
  Solution for submitting dialog with Ctrl + Enter (#4496) (#4592)
  Bump mysql-connector-java from 8.0.13 to 8.0.14 (#4599)

# Conflicts:
#	src/main/resources/l10n/JabRef_en.properties
  • Loading branch information
Siedlerchr committed Feb 1, 2019
2 parents 014dd12 + 629fcc4 commit c273ecb
Show file tree
Hide file tree
Showing 77 changed files with 2,421 additions and 2,940 deletions.
20 changes: 8 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ status.md
# Install4J
install4j6/

# Snap
parts/
stage/
prime/
*.snap
jabref_source.tar.bz2
snap/.snapcraft/

# Gradle
# generated when `gradlew --gui` is called
ui/
Expand All @@ -23,18 +31,6 @@ ui/
jabref.xml
*.sonargraph

# Snapcraft - JabRef places the files into buildres/snapcraft
snap/










# Created by https://www.gitignore.io/api/gradle,java,jabref,intellij,eclipse,netbeans,windows,linux,macos,node,snapcraft

### Eclipse ###
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We added the ability to have an export preference where previously "File"-->"Export"/"Export selected entries" would not save the user's preference[#4495](https://github.com/JabRef/jabref/issues/4495)
- We added the ability to add field names from the Preferences Dialog [#4546](https://github.com/JabRef/jabref/issues/4546)
- We added the ability change the column widths directly in the main table. [#4546](https://github.com/JabRef/jabref/issues/4546)
- We added the ability to execute default action in dialog by using with <kbd>Ctrl</kbd> + <kbd>Enter</kbd> combination [#4496](https://github.com/JabRef/jabref/issues/4496)



Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ dependencies {
antlr4 'org.antlr:antlr4:4.7.2'
compile 'org.antlr:antlr4-runtime:4.7.2'

compile 'mysql:mysql-connector-java:8.0.13'
compile 'mysql:mysql-connector-java:8.0.14'

compile 'org.postgresql:postgresql:42.2.5'

Expand Down Expand Up @@ -171,7 +171,7 @@ dependencies {
testRuntime 'org.apache.logging.log4j:log4j-core:2.11.1'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.1'
testCompile 'org.mockito:mockito-core:2.23.4'
testCompile 'com.github.tomakehurst:wiremock:2.20.0'
testCompile 'com.github.tomakehurst:wiremock:2.21.0'
testCompile 'org.assertj:assertj-swing-junit:3.8.0'
testCompile 'org.reflections:reflections:0.9.11'
testCompile 'org.xmlunit:xmlunit-core:2.6.2'
Expand All @@ -181,7 +181,7 @@ dependencies {
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

checkstyle 'com.puppycrawl.tools:checkstyle:8.16'
checkstyle 'com.puppycrawl.tools:checkstyle:8.17'
}

jacoco {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ GenericName=BibTeX Editor
Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.
Type=Application
Terminal=false
Icon=${SNAP}/meta/gui/JabRef-icon-256.png
Icon=${SNAP}/meta/gui/jabref.png
Exec=jabref %U
Keywords=bibtex;biblatex;latex;bibliography
Categories=Office;
Expand Down
File renamed without changes
41 changes: 41 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: jabref
version: "git"
version-script: cat build.gradle | grep "^version =" | cut -d'"' -f2
#icon: snap/gui/jabref.png
summary: Bibliography manager
description: JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format.

grade: devel
confinement: strict

architectures:
- build-on: amd64
- build-on: i386

apps:
jabref:
command: desktop-launch java -jar $SNAP/jar/JabRef-$SNAP_VERSION.jar
environment:
_JAVA_OPTIONS: "-Duser.home=$SNAP_USER_DATA"
plugs:
- desktop
- desktop-legacy
- wayland
- unity7
- home
- opengl
- network-bind
- removable-media

parts:
jabref:
plugin: gradle
source: .
source-type: git
stage-packages:
- openjdk-8-jre
- openjfx
- x11-utils
gradle-options: [snapJar, -xtest]
gradle-output-dir: 'build/releases'
after: [desktop-gtk2]
35 changes: 0 additions & 35 deletions snapcraft.yaml

This file was deleted.

12 changes: 8 additions & 4 deletions src/main/java/org/jabref/FallbackExceptionHandler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref;

import org.jabref.gui.util.DefaultTaskExecutor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -17,9 +19,11 @@ public static void installExceptionHandler() {
@Override
public void uncaughtException(Thread thread, Throwable exception) {
LOGGER.error("Uncaught exception occurred in " + thread, exception);
JabRefGUI.getMainFrame()
.getDialogService()
.showErrorDialogAndWait(
exception.getLocalizedMessage(), exception);

DefaultTaskExecutor.runInJavaFXThread(() ->
JabRefGUI.getMainFrame()
.getDialogService()
.showErrorDialogAndWait("Uncaught exception occurred in " + thread, exception)
);
}
}
12 changes: 7 additions & 5 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -1345,39 +1345,41 @@ public void listen(EntryRemovedEvent entryRemovedEvent) {
/**
* Ensures that the search auto completer is up to date when entries are changed AKA Let the auto completer, if any,
* harvest words from the entry
* Actual methods for autocomplete indexing must run in javafx thread
*/
private class SearchAutoCompleteListener {

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

@Subscribe
public void listen(EntryChangedEvent entryChangedEvent) {
searchAutoCompleter.indexEntry(entryChangedEvent.getBibEntry());
DefaultTaskExecutor.runInJavaFXThread(() -> searchAutoCompleter.indexEntry(entryChangedEvent.getBibEntry()));
}
}

/**
* Ensures that the results of the current search are updated when a new entry is inserted into the database
* Actual methods for performing search must run in javafx thread
*/
private class SearchListener {

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

@Subscribe
public void listen(EntryChangedEvent entryChangedEvent) {
frame.getGlobalSearchBar().performSearch();
DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch());
}

@Subscribe
public void listen(EntryRemovedEvent removedEntryEvent) {
// IMO only used to update the status (found X entries)
frame.getGlobalSearchBar().performSearch();
DefaultTaskExecutor.runInJavaFXThread(() -> frame.getGlobalSearchBar().performSearch());
}
}

Expand Down
17 changes: 13 additions & 4 deletions src/main/java/org/jabref/gui/DialogService.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jabref.gui;

import java.io.IOException;
import java.nio.file.Path;
import java.util.Collection;
import java.util.List;
Expand Down Expand Up @@ -139,7 +140,7 @@ default void showErrorDialogAndWait(Exception exception) {
* @return true if the use clicked "YES" otherwise false
*/
boolean showConfirmationDialogWithOptOutAndWait(String title, String content,
String optOutMessage, Consumer<Boolean> optOutAction);
String optOutMessage, Consumer<Boolean> optOutAction);

/**
* Create and display a new confirmation dialog.
Expand All @@ -151,8 +152,8 @@ boolean showConfirmationDialogWithOptOutAndWait(String title, String content,
* @return true if the use clicked "YES" otherwise false
*/
boolean showConfirmationDialogWithOptOutAndWait(String title, String content,
String okButtonLabel, String cancelButtonLabel,
String optOutMessage, Consumer<Boolean> optOutAction);
String okButtonLabel, String cancelButtonLabel,
String optOutMessage, Consumer<Boolean> optOutAction);

/**
* This will create and display a new dialog of the specified
Expand All @@ -162,7 +163,7 @@ boolean showConfirmationDialogWithOptOutAndWait(String title, String content,
* @return Optional with the pressed Button as ButtonType
*/
Optional<ButtonType> showCustomButtonDialogAndWait(Alert.AlertType type, String title, String content,
ButtonType... buttonTypes);
ButtonType... buttonTypes);

/**
* This will create and display a new dialog showing a custom {@link DialogPane}
Expand Down Expand Up @@ -247,4 +248,12 @@ Optional<ButtonType> showCustomButtonDialogAndWait(Alert.AlertType type, String
*/
boolean showPrintDialog(PrinterJob job);

/**
* Shows a new dialog that list all files contained in the given archive and which lets the user select one of these
* files. The method doesn't return until the displayed open dialog is dismissed. The return value specifies the
* file chosen by the user or an empty {@link Optional} if no selection has been made.
*
* @return the selected file or an empty {@link Optional} if no file has been selected
*/
Optional<Path> showFileOpenFromArchiveDialog(Path archivePath) throws IOException;
}
Loading

0 comments on commit c273ecb

Please sign in to comment.