From 96491c489a038748a849b8b6bd98ce0345cd1654 Mon Sep 17 00:00:00 2001 From: CaptainDaVinci Date: Sun, 20 Oct 2019 23:56:53 +0530 Subject: [PATCH 1/2] Open entry editor by default on start-up Fixes #5460 Select the first entry in the main table, and open entry editor for the same. This action is performed on the application thread. --- src/main/java/org/jabref/gui/BasePanel.java | 10 ++++++++++ src/main/java/org/jabref/gui/maintable/MainTable.java | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index fc5c9ed8d59..ecc1673e29b 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -178,6 +178,8 @@ public BasePanel(JabRefFrame frame, BasePanelPreferences preferences, BibDatabas this.getDatabase().registerListener(new UpdateTimestampListener(Globals.prefs)); this.entryEditor = new EntryEditor(this, externalFileTypes); + // Open entry editor for first entry on start up. + Platform.runLater(() -> clearAndSelectFirst()); } @Subscribe @@ -867,6 +869,14 @@ public void clearAndSelect(final BibEntry bibEntry) { mainTable.clearAndSelect(bibEntry); } + /** + * Select and open entry editor for first entry in main table. + */ + private void clearAndSelectFirst() { + mainTable.clearAndSelectFirst(); + showAndEdit(); + } + public void selectPreviousEntry() { mainTable.getSelectionModel().clearAndSelect(mainTable.getSelectionModel().getSelectedIndex() - 1); } diff --git a/src/main/java/org/jabref/gui/maintable/MainTable.java b/src/main/java/org/jabref/gui/maintable/MainTable.java index cc6bc3d4b77..dc9392ff1bd 100644 --- a/src/main/java/org/jabref/gui/maintable/MainTable.java +++ b/src/main/java/org/jabref/gui/maintable/MainTable.java @@ -206,7 +206,7 @@ private void setupKeyBindings(KeyBindingRepository keyBindings) { }); } - private void clearAndSelectFirst() { + public void clearAndSelectFirst() { getSelectionModel().clearSelection(); getSelectionModel().selectFirst(); scrollTo(0); From 7306354b0f65952718554a8a7cd5e8ed44ebd187 Mon Sep 17 00:00:00 2001 From: CaptainDaVinci Date: Mon, 21 Oct 2019 01:01:47 +0530 Subject: [PATCH 2/2] Updated CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06dd4948f7e..796c8e28ff5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We improved the display of group memberships by adding multiple colored bars if the entry belongs to more than one group. [#4574](https://github.com/JabRef/jabref/issues/4574) - We added an option to show the preview as an extra tab in the entry editor (instead of in a split view). [#5244](https://github.com/JabRef/jabref/issues/5244) - A custom Open/LibreOffice jstyle file now requires a layout line for the entry type `default` [#5452](https://github.com/JabRef/jabref/issues/5452) +- The entry editor is now open by default when JabRef starts up. [#5460](https://github.com/JabRef/jabref/issues/5460) ### Fixed