Skip to content

Commit

Permalink
Merge pull request #5483 from JabRef/fixnotonfxthread
Browse files Browse the repository at this point in the history
Fix not on fx thread error for custom entry types
  • Loading branch information
Siedlerchr authored Oct 21, 2019
2 parents ba8ce99 + 37d4ca1 commit f86944a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.Iterator;
import java.util.List;

import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;

Expand Down Expand Up @@ -41,12 +42,10 @@ public class JabRefGUI {
private final boolean isBlank;
private final List<ParserResult> failed = new ArrayList<>();
private final List<ParserResult> toOpenTab = new ArrayList<>();
private final JabRefExecutorService executorService;

public JabRefGUI(Stage mainStage, List<ParserResult> databases, boolean isBlank) {
this.bibDatabases = databases;
this.isBlank = isBlank;
executorService = JabRefExecutorService.INSTANCE;
mainFrame = new JabRefFrame(mainStage);

openWindow(mainStage);
Expand Down Expand Up @@ -89,8 +88,7 @@ private void openWindow(Stage mainStage) {
event.consume();
}
});

executorService.execute(this::openDatabases);
Platform.runLater(this::openDatabases);
}

private void openDatabases() {
Expand Down Expand Up @@ -176,6 +174,7 @@ private void openDatabases() {
for (int i = 0; (i < bibDatabases.size()) && (i < mainFrame.getBasePanelCount()); i++) {
ParserResult pr = bibDatabases.get(i);
BasePanel panel = mainFrame.getBasePanelAt(i);

OpenDatabaseAction.performPostOpenActions(panel, pr);
}

Expand Down

0 comments on commit f86944a

Please sign in to comment.