Source:
private void styleFetchedListView(CheckListView<CitationRelationItem> listView) { PseudoClass entrySelected = PseudoClass.getPseudoClass("selected"); new ViewModelListCellFactory<CitationRelationItem>() .withGraphic(e -> { HBox separator = new HBox(); HBox.setHgrow(separator, Priority.SOMETIMES); Node entryNode = BibEntryView.getEntryNode(e.getBibEntry()); HBox.setHgrow(entryNode, Priority.ALWAYS); HBox hContainer = new HBox(); hContainer.prefWidthProperty().bind(listView.widthProperty().subtract(25)); if (e.isLocal()) { Button jumpTo = IconTheme.JabRefIcons.LINK.asButton(); jumpTo.setTooltip(new Tooltip(Localization.lang("Jump to entry in database"))); jumpTo.getStyleClass().add("addEntryButton"); jumpTo.setOnMouseClicked(event -> { libraryTab.showAndEdit(e.getBibEntry()); libraryTab.clearAndSelect(e.getBibEntry()); citingTask.cancel(); citedByTask.cancel(); }); hContainer.getChildren().addAll(entryNode, separator, jumpTo); } else { ToggleButton addToggle = IconTheme.JabRefIcons.ADD.asToggleButton(); addToggle.setTooltip(new Tooltip(Localization.lang("Select entry"))); EasyBind.subscribe(addToggle.selectedProperty(), selected -> { if (selected) { addToggle.setGraphic(IconTheme.JabRefIcons.ADD_FILLED.withColor(IconTheme.SELECTED_COLOR).getGraphicNode()); } else { addToggle.setGraphic(IconTheme.JabRefIcons.ADD.getGraphicNode()); } }); addToggle.getStyleClass().add("addEntryButton"); addToggle.selectedProperty().bindBidirectional(listView.getItemBooleanProperty(e)); hContainer.getChildren().addAll(entryNode, separator, addToggle); } hContainer.getStyleClass().add("entry-container"); return hContainer; }) .withOnMouseClickedEvent((ee, event) -> { if (!ee.isLocal()) { listView.getCheckModel().toggleCheckState(ee); } }) .withPseudoClass(entrySelected, listView::getItemBooleanProperty) .install(listView); listView.setSelectionModel(new NoSelectionModel<>()); }

Target:
private void styleFetchedListView(CheckListView<CitationRelationItem> listView) { PseudoClass entrySelected = PseudoClass.getPseudoClass("selected"); new ViewModelListCellFactory<CitationRelationItem>() .withGraphic(entry -> { HBox separator = new HBox(); HBox.setHgrow(separator, Priority.SOMETIMES); Node entryNode = BibEntryView.getEntryNode(entry.getEntry()); HBox.setHgrow(entryNode, Priority.ALWAYS); HBox hContainer = new HBox(); hContainer.prefWidthProperty().bind(listView.widthProperty().subtract(25)); if (entry.isLocal()) { Button jumpTo = IconTheme.JabRefIcons.LINK.asButton(); jumpTo.setTooltip(new Tooltip(Localization.lang("Jump to entry in database"))); jumpTo.getStyleClass().add("addEntryButton"); jumpTo.setOnMouseClicked(event -> { libraryTab.showAndEdit(entry.getEntry()); libraryTab.clearAndSelect(entry.getEntry()); citingTask.cancel(); citedByTask.cancel(); }); hContainer.getChildren().addAll(entryNode, separator, jumpTo); } else { ToggleButton addToggle = IconTheme.JabRefIcons.ADD.asToggleButton(); addToggle.setTooltip(new Tooltip(Localization.lang("Select entry"))); EasyBind.subscribe(addToggle.selectedProperty(), selected -> { if (selected) { addToggle.setGraphic(IconTheme.JabRefIcons.ADD_FILLED.withColor(IconTheme.SELECTED_COLOR).getGraphicNode()); } else { addToggle.setGraphic(IconTheme.JabRefIcons.ADD.getGraphicNode()); } }); addToggle.getStyleClass().add("addEntryButton"); addToggle.selectedProperty().bindBidirectional(listView.getItemBooleanProperty(entry)); hContainer.getChildren().addAll(entryNode, separator, addToggle); } hContainer.getStyleClass().add("entry-container"); return hContainer; }) .withOnMouseClickedEvent((ee, event) -> { if (!ee.isLocal()) { listView.getCheckModel().toggleCheckState(ee); } }) .withPseudoClass(entrySelected, listView::getItemBooleanProperty) .install(listView); listView.setSelectionModel(new NoSelectionModel<>()); }