Jabref: Add tooltips for all entry types

Created on 6 Mar 2020  路  8Comments  路  Source: JabRef/jabref

When creating a new entry or when editing the entry type of an existing entry in a library, it would be useful, if tooltips describe each possible entry type.

The required content of the tooltips could be simply used from the following files:

Requirements:

  • A tooltip should contain detailed information for what this entry type is used.
  • The information within a tooltip should be self-contained, without the need to look up other external documents and without being linked to other entry types.

The tooltips could be added in the following areas:

  • When the "Select entry type" dialog is opened (e.g. Library > New entry)

    • Hovering a button of an entry type should show the tooltip

  • When changing the entry type in the entry editor. (left side of the entry editor)

    • Hovering an entry type in the list should show the tooltip

  • When right clicking a reference in the main table and clicking Change entry type

    • Hovering an entry type in the list should show the tooltip

good first issue enhancement ui

All 8 comments

I'd like to work on that.

@dimitra-karadima That would be really great! :)

@dimitra-karadima To probably boost your productivity a bit, you could maybe find it useful to grab some ideas from the code of the PR #6046. Simple textual (non-html) tooltips will be sufficient for this PR, thus the lengthy discussion of the linked PR is not that relevant for you. But feel free to implement it as you think it is best for you. :)

@systemoperator Thank you for the additional tips. I will take everything into notice and see how it is going to work out in the end.

Hey @systemoperator ,
I have been trying to implement the tooltip enhancement in the first option you described, when the "Select entry type" dialog is opened. All I have found is that the dialog box opens from the org.jabref.gui.importer.NewEntryAction.java and I tryied implementing a getDescription method as PR #6046 has. But my attempt failed, because the method setTooltip does not work for the NewEntryAction. So, if you have any suggestion on how to fix that or if you know onther class I should put the Tooltip with the getDescription method, it would be really much appreciated!

@dimitra-karadima An interesting class is org.jabref.gui.EntryTypeView.java. Here you will find

https://github.com/JabRef/jabref/blob/093a6fb1ebd0fbcbd9bcd365bd828273255ca794/src/main/java/org/jabref/gui/EntryTypeView.java#L99

In this method

https://github.com/JabRef/jabref/blob/093a6fb1ebd0fbcbd9bcd365bd828273255ca794/src/main/java/org/jabref/gui/EntryTypeView.java#L122 decides on whether bibtex or biblatex mode is active.

If e.g. biblatex is active, the following line gets executed, which adds the available entries to the pane:

https://github.com/JabRef/jabref/blob/093a6fb1ebd0fbcbd9bcd365bd828273255ca794/src/main/java/org/jabref/gui/EntryTypeView.java#L123

And the full method is:

https://github.com/JabRef/jabref/blob/093a6fb1ebd0fbcbd9bcd365bd828273255ca794/src/main/java/org/jabref/gui/EntryTypeView.java#L89-L96

You can associate a tooltip to a button like that:

Tooltip tooltip = new Tooltip();
tooltip.setText(description);
entryButton.setTooltip(tooltip);

@systemoperator Thank you so much for your suggestion, I will try that and let you know!

Thanks to @dimitra-karadima this issue should now be fixed

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oscargus picture oscargus  路  3Comments

Siedlerchr picture Siedlerchr  路  3Comments

a-torgovitsky picture a-torgovitsky  路  3Comments

tobiasdiez picture tobiasdiez  路  4Comments

Siedlerchr picture Siedlerchr  路  3Comments