Skip to content

Commit

Permalink
Added double click to jump to entry in CitationRelationsTab (JabRef#1…
Browse files Browse the repository at this point in the history
…1955)

* Added double click to jump to entry in CitationRelationsTab

* CHANGELOG.md

---------

Co-authored-by: Oliver Kopp <[email protected]>
  • Loading branch information
2 people authored and ExrosZ-Alt committed Oct 17, 2024
1 parent 56ad9e0 commit 950dab1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658)
- We added a setting which always adds the literal "Cited on pages" text before each JStyle citation. [#11691](https://github.com/JabRef/jabref/pull/11732)
- We added a new plain citation parser that uses LLMs. [#11825](https://github.com/JabRef/jabref/issues/11825)
- By double clicking on a local citation in the Citation Relations Tab you can now jump the the linked entry. [#11955](https://github.com/JabRef/jabref/pull/11955)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ private void styleFetchedListView(CheckListView<CitationRelationItem> listView)
Button jumpTo = IconTheme.JabRefIcons.LINK.asButton();
jumpTo.setTooltip(new Tooltip(Localization.lang("Jump to entry in library")));
jumpTo.getStyleClass().add("addEntryButton");
jumpTo.setOnMouseClicked(event -> {
citingTask.cancel();
citedByTask.cancel();
libraryTab.showAndEdit(entry.localEntry());
libraryTab.clearAndSelect(entry.localEntry());
jumpTo.setOnMouseClicked(event -> jumpToEntry(entry));
hContainer.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
jumpToEntry(entry);
}
});
vContainer.getChildren().add(jumpTo);
} else {
Expand Down Expand Up @@ -295,6 +295,13 @@ private void styleFetchedListView(CheckListView<CitationRelationItem> listView)
listView.setSelectionModel(new NoSelectionModel<>());
}

private void jumpToEntry(CitationRelationItem entry) {
citingTask.cancel();
citedByTask.cancel();
libraryTab.showAndEdit(entry.localEntry());
libraryTab.clearAndSelect(entry.localEntry());
}

/**
* @implNote This code is similar to {@link PreviewWithSourceTab#getSourceString(BibEntry, BibDatabaseMode, FieldPreferences, BibEntryTypesManager)}.
*/
Expand Down

0 comments on commit 950dab1

Please sign in to comment.