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

FIx only one linked files showing in tooltip #12471

Closed
wants to merge 9 commits into from
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv

### Changed

- Change Tooltip to display all linked Files when Hovering instead of only displays the First Linked File. [#12470](https://github.com/JabRef/jabref/issues/12470)
- We improved the offline parsing of BibTeX data from PDF-documents. [#12278](https://github.com/JabRef/jabref/issues/12278)
- The tab bar is now hidden when only one library is open. [#9971](https://github.com/JabRef/jabref/issues/9971)

Expand Down
11 changes: 10 additions & 1 deletion src/main/java/org/jabref/gui/maintable/columns/FileColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,20 @@ private void setCommonSettings() {

private String createFileTooltip(List<LinkedFile> linkedFiles) {
if (!linkedFiles.isEmpty()) {
return Localization.lang("Open file %0", linkedFiles.getFirst().getLink());
StringBuilder tooltipText = new StringBuilder();

// Iterate through all linked files and append their links to the tooltip text
Copy link
Member

@Siedlerchr Siedlerchr Feb 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all here comments as the code is self explanatory

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the feedback! I've removed all the comments.

for (LinkedFile linkedFile : linkedFiles) {
tooltipText.append(linkedFile.getLink()).append("\n"); // Add a new line between each link
}

// Return the concatenated text as a formatted tooltip
return Localization.lang("Open files: \n%0", tooltipText.toString());
}
return null;
}


private ContextMenu createFileMenu(BibEntryTableViewModel entry, List<LinkedFile> linkedFiles) {
if (linkedFiles.size() <= 1) {
return null;
Expand Down