@@ -169,17 +169,19 @@ public EntryEditor(Supplier<LibraryTab> tabSupplier, UndoAction undoAction, Redo
169
169
}
170
170
});
171
171
172
- stateManager .getSelectedEntries ().addListener ((InvalidationListener ) c -> {
172
+ stateManager .getSelectedEntries ().addListener ((InvalidationListener ) _ -> {
173
173
if (stateManager .getSelectedEntries ().isEmpty ()) {
174
- setCurrentlyEditedEntry (new BibEntry ());
174
+ // [impl->req~entry-editor.keep-showing~1]
175
+ // No change in the entry editor
176
+ // We allow users to edit the "old" entry
175
177
} else {
176
178
setCurrentlyEditedEntry (stateManager .getSelectedEntries ().getFirst ());
177
179
}
178
180
}
179
181
);
180
182
181
183
EasyBind .listen (preferences .getPreviewPreferences ().showPreviewAsExtraTabProperty (),
182
- (obs , oldValue , newValue ) -> {
184
+ (_ , _ , newValue ) -> {
183
185
if (currentlyEditedEntry != null ) {
184
186
adaptVisibleTabs ();
185
187
Tab tab = tabbed .getSelectionModel ().selectedItemProperty ().get ();
@@ -425,14 +427,12 @@ public void setCurrentlyEditedEntry(@NonNull BibEntry currentlyEditedEntry) {
425
427
typeSubscription .unsubscribe ();
426
428
}
427
429
428
- if (!currentlyEditedEntry .isEmpty ()) {
429
- typeSubscription = EasyBind .subscribe (this .currentlyEditedEntry .typeProperty (), _ -> {
430
- typeLabel .setText (new TypedBibEntry (currentlyEditedEntry , tabSupplier .get ().getBibDatabaseContext ().getMode ()).getTypeForDisplay ());
431
- adaptVisibleTabs ();
432
- setupToolBar ();
433
- getSelectedTab ().notifyAboutFocus (currentlyEditedEntry );
434
- });
435
- }
430
+ typeSubscription = EasyBind .subscribe (this .currentlyEditedEntry .typeProperty (), _ -> {
431
+ typeLabel .setText (new TypedBibEntry (currentlyEditedEntry , tabSupplier .get ().getBibDatabaseContext ().getMode ()).getTypeForDisplay ());
432
+ adaptVisibleTabs ();
433
+ setupToolBar ();
434
+ getSelectedTab ().notifyAboutFocus (currentlyEditedEntry );
435
+ });
436
436
437
437
if (preferences .getEntryEditorPreferences ().showSourceTabByDefault ()) {
438
438
tabbed .getSelectionModel ().select (sourceTab );
0 commit comments