Bug 331344 - [hovering] Remember preferred maximum size for Show Tooltip Description
Summary: [hovering] Remember preferred maximum size for Show Tooltip Description
Status: ASSIGNED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.6.1   Edit
Hardware: All All
: P5 enhancement with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard: fix candidate
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-29 09:36 EST by Björn Michael CLA
Modified: 2024-05-03 05:59 EDT (History)
3 users (show)

See Also:


Attachments
Javadoc label in Eclipse that shows a truncated returns clause. (20.46 KB, image/png)
2024-05-03 05:30 EDT, Volker Lukas CLA
no flags Details
The documentations and the labels size increased, but label is still short. (25.84 KB, image/png)
2024-05-03 05:36 EDT, Volker Lukas CLA
no flags Details
Returns element invisible following first sentence and four parameters. (41.23 KB, image/png)
2024-05-03 05:44 EDT, Volker Lukas CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Björn Michael CLA 2010-11-29 09:36:59 EST
Build Identifier: 20100917-0705

A tooltip is opened with a calculated preferred size in a java editor after moving the mouse cursor over e.g. a method declaration. Unfortunately, this size is usually too small and has to be resized each time which is really annoying. It will be useful to have an option like "Remember Size".
This feature has already been implemented in Quick Type Hierarchy. It is possible to enable "Remember Size" and "Remember Location" there.

Additional information
commandId: org.eclipse.ui.edit.text.showInformation
keyBinding: F2
name: show tooltip description


Reproducible: Always

Steps to Reproduce:
1. Move the mouse cursor over a method declaration in a Java source file.
2. Resize the tooltip.
3. Move the mouse cursor over another method declaration in a Java source file.
4. Tooltip size is restored.
Comment 1 Björn Michael CLA 2010-11-29 09:41:53 EST
(In reply to comment #0)
> 4. Tooltip size is restored.

4. Tooltip size has been reset.
Comment 2 Markus Keller CLA 2011-03-04 12:56:30 EST
In contrast to the Quick Type Hierarchy, we try to make the Javadoc hovers as small as possible initially (so that they show all contents but don't contain unnecessary white space). Therefore, the Javadoc hover size can only be a "Preferred maximum size".

Since the hovers don't always start with the same size, and since you can move the mouse into the hovers and quickly resize them depending on how much you want to see of a specific hover, I think the best strategy is not a general "Remember size" mode, but an explicit "Remember as maximum size" action.

That way, you can still resize the hovers dynamically without affecting the stored maximum. If you feel like you need to resize them all the time, the action would allow you to store a maximum size explicitly.
Comment 3 Björn Michael CLA 2011-03-04 14:09:31 EST
This is ok for me.
Comment 4 Volker Lukas CLA 2024-05-03 05:30:13 EDT
Created attachment 289380 [details]
Javadoc label in Eclipse that shows a truncated returns clause.
Comment 5 Volker Lukas CLA 2024-05-03 05:36:31 EDT
Created attachment 289383 [details]
The documentations and the labels size increased, but label is still short.
Comment 6 Volker Lukas CLA 2024-05-03 05:44:23 EDT
Created attachment 289386 [details]
Returns element invisible following first sentence and four parameters.
Comment 7 Volker Lukas CLA 2024-05-03 05:54:25 EDT
(In reply to Markus Keller from comment #2)
> In contrast to the Quick Type Hierarchy, we try to make the Javadoc hovers
> as small as possible initially (so that they show all contents but don't
> contain unnecessary white space). Therefore, the Javadoc hover size can only
> be a "Preferred maximum size".
I'd like to describe the current status, the way it appears in my Eclipse installation: The Javadoc tooltips (hovering labels) adapt to the amount of documentation that is provided for the Java element in question, but the way the size of the labels is calculated could be improved. More precisely, quite often it is too short and will cut off, for example, a "@returns" clause of a Javadoc snippet, even if enough screen space is available. I understand that those labels should not waste space but I personally would find it helpful when viewing a Java methods documentation to see most of the relevant documentation clauses, like parameters and return value, without resizing the label.

I have attached parts of three screenshots to illustrate what I mean.

The first image shows how even for a tiny Java method with only two parameters and a short introductory sentence the "@return" clause is omitted from the initially visible contents of the tooltip.

The second image confirms your statement that the labels size does in fact adapt to the amount of documentation. But as the documentation also grew, the label still cuts out relevant content, even though just a few more pixels in height would suffice to render the whole Javadoc snippet.

The final screenshot just shows, that if elements are added to a documentation snippet, the tooltip label grows further, but a relevant "@returns" clause is still invisible.

I observe this behavior on Windows 10 with all recent Eclipse releases up to and including 2024-03 (precisely
Version: 2024-03 (4.31.0)
Build id: 20240307-1437
).

Only if consensus exists for that, I do suggest to render the complete Javadoc snippet that is provived for a Java declaration within Eclipses documentation tooltip (hovering label) unless a maximum size would be exceeded.