Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added double click to jump to entry in CitationRelationsTab #11955

Merged
merged 3 commits into from
Oct 14, 2024
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
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
Loading