Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/main/java/org/jabref/gui/EntryTypeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import javafx.application.Platform;
import javafx.event.Event;
Expand Down Expand Up @@ -79,7 +80,7 @@ public EntryTypeView(BasePanel basePanel, DialogService dialogService, JabRefPre

EasyBind.subscribe(viewModel.searchSuccesfulProperty(), value -> {
if (value) {
setEntryTypeForReturnAndClose(null);
setEntryTypeForReturnAndClose(Optional.empty());
}
});

Expand All @@ -89,7 +90,7 @@ private void addEntriesToPane(FlowPane pane, Collection<? extends BibEntryType>
for (BibEntryType entryType : entries) {
Button entryButton = new Button(entryType.getType().getDisplayName());
entryButton.setUserData(entryType);
entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(entryType));
entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(Optional.of(entryType)));
pane.getChildren().add(entryButton);
}
}
Expand Down Expand Up @@ -162,8 +163,8 @@ private void focusTextField(Event event) {
idTextField.selectAll();
}

private void setEntryTypeForReturnAndClose(BibEntryType entryType) {
type = entryType.getType();
private void setEntryTypeForReturnAndClose(Optional<BibEntryType> entryType) {
type = entryType.map(BibEntryType::getType).orElse(null);
viewModel.stopFetching();
this.close();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/csl-styles
Submodule csl-styles updated 503 files