Skip to content

Commit

Permalink
Merge pull request #5488 from CaptainDaVinci/issue-5460
Browse files Browse the repository at this point in the history
Open entry editor by default on start-up
  • Loading branch information
Siedlerchr authored Oct 21, 2019
2 parents 80cf7fc + 7306354 commit 0f0dce6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 10 additions & 0 deletions src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/maintable/MainTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private void setupKeyBindings(KeyBindingRepository keyBindings) {
});
}

private void clearAndSelectFirst() {
public void clearAndSelectFirst() {
getSelectionModel().clearSelection();
getSelectionModel().selectFirst();
scrollTo(0);
Expand Down

0 comments on commit 0f0dce6

Please sign in to comment.