From e320d9b7e124d596b6972e6dbfac6f12cb79b597 Mon Sep 17 00:00:00 2001 From: Siedlerchr Date: Sat, 5 Sep 2020 15:29:20 +0200 Subject: [PATCH] Refactor FXML and other gui elements to current architecture Make login to overleaf working Fix test imports --- src/main/java/org/jabref/gui/JabRefFrame.java | 2 +- .../SynchronizeWithShareLatexAction.java | 11 +-- .../gui/sharelatex/ShareLatexLoginDialog.fxml | 17 ++-- .../sharelatex/ShareLatexLoginDialogView.java | 28 +++--- .../ShareLatexLoginDialogViewModel.java | 7 -- .../sharelatex/ShareLatexProjectDialog.fxml | 15 ++-- .../ShareLatexProjectDialogView.java | 15 ++++ .../ShareLatexProjectDialogViewModel.java | 3 +- .../logic/sharelatex/ShareLatexParser.java | 1 - .../logic/sharelatex/SharelatexConnector.java | 12 +-- .../sharelatex/WebSocketClientWrapper.java | 8 +- .../ShareLatexContinueMessageEvent.java | 2 +- .../java/org/jabref/model/sharelatex/Arg.java | 2 +- .../sharelatex/ShareLatexJsonMessageTest.java | 2 +- .../sharelatex/ShareLatexManagerTest.java | 7 +- .../sharelatex/ShareLatexParserTest.java | 88 +++++++++---------- .../sharelatex/SharelatexConnectorTest.java | 12 +-- 17 files changed, 109 insertions(+), 123 deletions(-) rename src/main/{resources => java}/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml (77%) delete mode 100644 src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialogViewModel.java rename src/main/{resources => java}/org/jabref/gui/sharelatex/ShareLatexProjectDialog.fxml (65%) diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 7ae3f402b78..d2fc140e5e2 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -751,7 +751,7 @@ private MenuBar createMenu() { factory.createSubMenu(StandardActions.REMOTE_DB, factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)), factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new PullChangesFromSharedAction(stateManager)), - factory.createMenuItem(StandardActions.SYNCHRONIZE_WITH_SHARELATEX, new SynchronizeWithShareLatexAction(dialogService)) + factory.createMenuItem(StandardActions.SYNCHRONIZE_WITH_SHARELATEX, new SynchronizeWithShareLatexAction()) ), new SeparatorMenuItem(), diff --git a/src/main/java/org/jabref/gui/actions/SynchronizeWithShareLatexAction.java b/src/main/java/org/jabref/gui/actions/SynchronizeWithShareLatexAction.java index b893f8e46b9..1f780892279 100644 --- a/src/main/java/org/jabref/gui/actions/SynchronizeWithShareLatexAction.java +++ b/src/main/java/org/jabref/gui/actions/SynchronizeWithShareLatexAction.java @@ -1,20 +1,11 @@ package org.jabref.gui.actions; -import org.jabref.gui.DialogService; import org.jabref.gui.sharelatex.ShareLatexLoginDialogView; public class SynchronizeWithShareLatexAction extends SimpleCommand { - private DialogService dialogService; - - public SynchronizeWithShareLatexAction(DialogService dialogService) { - super(); - this.dialogService = dialogService; - } - @Override public void execute() { - dialogService.showCustomDialogAndWait( - new ShareLatexLoginDialogView()); + new ShareLatexLoginDialogView().showAndWait(); } } diff --git a/src/main/resources/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml b/src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml similarity index 77% rename from src/main/resources/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml rename to src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml index 5da7131ce7a..467aebc57a9 100644 --- a/src/main/resources/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml +++ b/src/main/java/org/jabref/gui/sharelatex/ShareLatexLoginDialog.fxml @@ -2,6 +2,7 @@ + @@ -27,22 +28,18 @@ - - - - -