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

Add tooltips for all entry types #6074

Closed
systemoperator opened this issue Mar 6, 2020 · 8 comments · Fixed by #6203
Closed

Add tooltips for all entry types #6074

systemoperator opened this issue Mar 6, 2020 · 8 comments · Fixed by #6203
Labels
good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement ui

Comments

@systemoperator
Copy link
Contributor

systemoperator commented Mar 6, 2020

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
@tobiasdiez tobiasdiez added type: enhancement good first issue An issue intended for project-newcomers. Varies in difficulty. ui labels Mar 9, 2020
@dimitra-karadima
Copy link
Contributor

I'd like to work on that.

@systemoperator
Copy link
Contributor Author

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

@systemoperator
Copy link
Contributor Author

@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. :)

@dimitra-karadima
Copy link
Contributor

@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.

@dimitra-karadima
Copy link
Contributor

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!

@systemoperator
Copy link
Contributor Author

systemoperator commented Mar 28, 2020

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

public void initialize() {

In this method

if (basePanel.getBibDatabaseContext().isBiblatexMode()) {
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:

addEntriesToPane(biblatexPane, BiblatexEntryTypeDefinitions.ALL);

And the full method is:

private void addEntriesToPane(FlowPane pane, Collection<? extends BibEntryType> entries) {
for (BibEntryType entryType : entries) {
Button entryButton = new Button(entryType.getType().getDisplayName());
entryButton.setUserData(entryType);
entryButton.setOnAction(event -> setEntryTypeForReturnAndClose(Optional.of(entryType)));
pane.getChildren().add(entryButton);
}
}

You can associate a tooltip to a button like that:

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

@dimitra-karadima
Copy link
Contributor

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

dimitra-karadima added a commit to dimitra-karadima/jabref that referenced this issue Mar 29, 2020
Change: Add tooltips in the "Select entry type" dialog. You can see the tooltip when hovering a button of an entry type.
dimitra-karadima added a commit to dimitra-karadima/jabref that referenced this issue Mar 30, 2020
Add the following changes:
-tooltips' description comes from biblatex documentation
-comment about the biblatex manual
-description to the english localization file
dimitra-karadima added a commit to dimitra-karadima/jabref that referenced this issue Apr 4, 2020
Add the following changes:
-refactor the tooltip to prevent display issues
-check if the entry type is StandardEntryType with instance of
-use quotes to describe another entry type in the tooltip's description
Siedlerchr added a commit that referenced this issue Apr 16, 2020
…ima/jabref into dimitra-karadima-fix-for-issue-6074

* 'fix-for-issue-6074' of https://github.com/dimitra-karadima/jabref:
  Change one more line
  Resolve unit test from failing
  Add one more change
  Fix errors
  Update EntryTypeView.java
  Change to the old school format
  Fix some issues
  Add tooltips when changing the entry type
  Refactor tooltip for #6074
  Change the tooltips' description for #6074
  Add tooltips for all entry types for #6074
Siedlerchr added a commit that referenced this issue Apr 16, 2020
* dimitra-karadima-fix-for-issue-6074:
  fix l10n
  Change one more line
  Resolve unit test from failing
  Add one more change
  Fix errors
  Update EntryTypeView.java
  Change to the old school format
  Fix some issues
  Add tooltips when changing the entry type
  Refactor tooltip for #6074
  Change the tooltips' description for #6074
  Add tooltips for all entry types for #6074
@Siedlerchr
Copy link
Member

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

koppor pushed a commit that referenced this issue Sep 1, 2022
8d69f16 Create university-of-hull-harvard.csl (#6146)
139dfdd Create current organic synthesis.csl (#6139)
bb006c8 Update acta-universitatis-agriculturae-sueciae.csl (#6143)
5815da0 Create food-science-and-biotechnology.csl (#6132)
2702a7c Update harvard-university-for-the-creative-arts.csl (#6104)
ef34543 Update economic-geology.csl (#6128)
0adcd30 Bump mathieudutour/github-tag-action from 5.6 to 6.0 (#6141)
3c36e97 Create universite-du-quebec-a-montreal-prenoms.csl (#6073)
415bc05 Bump softprops/action-gh-release from 0.1.14 to 1 (#6142)
ae8c5e4 Create politique-europeenne.csl (#6074)
09cbc09 Update cell-numeric-superscript.csl (#6188)
6ee1ace Update avian-conservation-and-ecology.csl (#6191)
cb5c43f Update harvard-anglia-ruskin-university.csl (#6189)
5c4f4c0 Create anais-da-academia-brasileira-de-ciencias.csl (#6066)
a60dfe9 Update cardiff-university-harvard.csl (#6190)
999a45c Create sociologia-urbana-e-rurale.csl (#6042)
1bc9d62 Bluebook (#6183)
a4f2a72 Oxford Brookes (#6182)
88df8d5 Delete harvard-cardiff-university-old.csl (#6180)
b9302fd Update APA styles for "event" macro (#6174)
d4daec6 remove DOI for printed articles organizational-studies.csl (#6176)
acfc620 Create liver-transplantation.csl (#6167)
129a775 Change "event" to "event-title" (#6164)

git-subtree-dir: buildres/csl/csl-styles
git-subtree-split: 8d69f16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue An issue intended for project-newcomers. Varies in difficulty. type: enhancement ui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants