From a051e1b08e45fbb6b79c83ce711e7b14f8c23fe8 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Sun, 13 Jan 2019 18:46:38 +0100 Subject: [PATCH] update jfoenix and gradle plugins Replace outdated transformer log4j2 with official new one --- build.gradle | 12 ++++++------ src/main/java/org/jabref/gui/JabRefFrame.java | 10 +++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index c2294a1ae4d..5f902290771 100644 --- a/build.gradle +++ b/build.gradle @@ -16,12 +16,11 @@ buildscript { plugins { id 'com.gradle.build-scan' version '1.16' - id 'com.install4j.gradle' version '7.0.8' - id 'com.github.johnrengelman.shadow' version '2.0.4' - id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1" + id 'com.install4j.gradle' version '7.0.9' + id 'com.github.johnrengelman.shadow' version '4.0.2' id "com.simonharrer.modernizer" version '1.6.0-1' - id 'me.champeau.gradle.jmh' version '0.4.7' - id 'net.ltgt.errorprone' version '0.6' + id 'me.champeau.gradle.jmh' version '0.4.8' + id 'net.ltgt.errorprone' version '0.6.1' id 'com.github.ben-manes.versions' version '0.20.0' } @@ -138,7 +137,7 @@ dependencies { compile 'org.fxmisc.richtext:richtextfx:0.9.2' compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1' compile 'javax.inject:javax.inject:1' - compile 'com.jfoenix:jfoenix:8.0.7' + compile 'com.jfoenix:jfoenix:8.0.8' // Cannot be updated to 9.*.* until Jabref works with Java 9 compile 'org.controlsfx:controlsfx:8.40.15-SNAPSHOT' @@ -419,6 +418,7 @@ modernizer { // Release tasks shadowJar { + transform(com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer) classifier 'fat' } diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 86c9f7ec54a..66e4643e1d2 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -48,6 +48,7 @@ import javafx.scene.layout.Pane; import javafx.scene.layout.Priority; import javafx.stage.Stage; +import javafx.util.Duration; import org.jabref.Globals; import org.jabref.JabRefExecutorService; @@ -131,6 +132,8 @@ import com.google.common.eventbus.Subscribe; import com.jfoenix.controls.JFXSnackbar; +import com.jfoenix.controls.JFXSnackbar.SnackbarEvent; +import com.jfoenix.controls.JFXSnackbarLayout; import org.eclipse.fx.ui.controls.tabpane.DndTabPane; import org.eclipse.fx.ui.controls.tabpane.DndTabPaneFactory; import org.fxmisc.easybind.EasyBind; @@ -147,6 +150,7 @@ public class JabRefFrame extends BorderPane implements OutputPrinter { public static final String FRAME_TITLE = "JabRef"; private static final Logger LOGGER = LoggerFactory.getLogger(JabRefFrame.class); + private static final Duration TOAST_MESSAGE_DISPLAY_TIME = Duration.millis(3000); private final SplitPane splitPane = new SplitPane(); private final JabRefPreferences prefs = Globals.prefs; @@ -1012,11 +1016,11 @@ public void addParserResult(ParserResult pr, boolean focusPanel) { /** * Displays the given message at the bottom of the main frame * - * @deprecated use {@link DialogService#notify(String)} instead + * @deprecated use {@link DialogService#notify(String)} instead. However, do not remove this method, it's called from the dialogService */ @Deprecated - public void output(final String s) { - DefaultTaskExecutor.runInJavaFXThread(() -> statusLine.show(s, 3000)); + public void output(final String message) { + DefaultTaskExecutor.runInJavaFXThread(() -> statusLine.fireEvent(new SnackbarEvent(new JFXSnackbarLayout(message), TOAST_MESSAGE_DISPLAY_TIME, null))); } private void initActions() {