Skip to content

Commit

Permalink
Open entry editor by default
Browse files Browse the repository at this point in the history
Fixes JabRef#5460

On setting up the base panel, select the first entry in maintable
and open the entry editor for the same.
  • Loading branch information
CaptainDaVinci committed Oct 20, 2019
1 parent dfad2fd commit e7ba40e
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
Empty file added .attach_pid27378
Empty file.
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 ediotr on startup.
clearAndSelectFirst();
}

@Subscribe
Expand Down Expand Up @@ -867,6 +869,14 @@ public void clearAndSelect(final BibEntry bibEntry) {
mainTable.clearAndSelect(bibEntry);
}

/**
* Selects and opens the 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
2 changes: 1 addition & 1 deletion src/main/resources/csl-locales
Submodule csl-locales updated 1 files
+10 −11 Gemfile.lock
2 changes: 1 addition & 1 deletion src/main/resources/csl-styles
Submodule csl-styles updated 39 files
+1 −1 acta-chiropterologica.csl
+0 −124 aims-press.csl
+1 −1 australian-archaeology.csl
+3 −3 buletin-agrohorti.csl
+107 −103 chicago-author-date-fr.csl
+0 −15 dependent/immunological-reviews.csl
+3 −6 dependent/joule.csl
+2 −4 dependent/one-earth.csl
+0 −480 european-union-interinstitutional-style-guide-author-date.csl
+1 −1 european-union-interinstitutional-style-guide.csl
+69 −53 harvard-university-for-the-creative-arts.csl
+79 −0 immunological-reviews.csl
+0 −193 journal-of-acoustics.csl
+0 −298 journal-of-advertising-research.csl
+1 −1 karger-journals.csl
+0 −181 les-nouvelles-de-l-archeologie.csl
+0 −279 maison-de-l-orient-et-de-la-mediterranee-en.csl
+46 −105 maison-de-l-orient-et-de-la-mediterranee.csl
+11 −25 modern-language-association.csl
+1 −1 national-institute-of-organisation-dynamics-australia-harvard.csl
+22 −31 nature.csl
+21 −19 plos.csl
+3 −3 springer-basic-author-date-no-et-al.csl
+3 −3 springer-basic-author-date.csl
+3 −3 springer-basic-brackets-no-et-al.csl
+3 −3 springer-basic-note.csl
+6 −6 springer-fachzeitschriften-medizin-psychologie.csl
+2 −2 springer-humanities-author-date.csl
+2 −2 springer-humanities-brackets.csl
+1 −2 springer-lecture-notes-in-computer-science.csl
+2 −2 springer-mathphys-author-date.csl
+2 −2 springer-mathphys-brackets.csl
+2 −2 springer-socpsych-author-date.csl
+2 −2 springer-socpsych-brackets.csl
+2 −2 springer-vancouver.csl
+2 −2 springer-vs-author-date.csl
+7 −20 tatup-zeitschrift-fur-technikfolgenabschatzung-in-theorie-und-praxis.csl
+52 −17 the-journal-of-the-acoustical-society-of-america.csl
+0 −234 weed-research.csl

0 comments on commit e7ba40e

Please sign in to comment.