Bug 334846 - [JFace] Provide public API for StickyHoverManager, and support for various controls
Summary: [JFace] Provide public API for StickyHoverManager, and support for various co...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: api
Depends on:
Blocks:
 
Reported: 2011-01-19 21:18 EST by Mark A. Ziesemer CLA
Modified: 2014-06-07 15:52 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark A. Ziesemer CLA 2011-01-19 21:18:50 EST
Build Identifier: 20100917-0705

Would like to make use of the "rich", "sticky" hovers (as found in the Javadoc hovers in the Java source editor in JDT) in other Eclipse plugins.

Most of the related code for this appears to be in StickyHoverManager and InformationControlReplacer (both in org.eclipse.jface.internal.text), and AbstractInformationControlManager (in org.eclipse.jface.text) - which has access to many related methods restricted.  (There is the getInternalAccessor() method, but any use results in a "discouraged access" warning.  It looks like maybe this isn't an issue for JDT, as at least some of this appears to be wired through TextViewer and SourceViewer.  Regardless, this functionality should be available for any type of control, e.g. a Tree.

Something similar was asked for by Chad at http://www.eclipse.org/forums/index.php?t=msg&goto=21775&S=3384a9c68fdee693e75830e60295bef0 on 2009-07-15, but that forum post never received any response.

More details of the functionality in question can be found at the following links:
- http://archive.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/whatsnew3.4/eclipse-news-part2.html - "Rich Javadoc Hover"
- http://dev.eclipse.org/blogs/jdtui/2008/04/30/allow-to-move-mouse-into-hover-or-how-to-make-it-stick/
- bug 200838
-- Found from http://www.eclipse.org/jdt/ui/r3_4/plan.php -> http://www.eclipse.org/eclipse/platform-text/3.4/plan.php#rich%20hovers

Interestingly, looking at the last attachment 86701 [details] on bug 200838, StickyHoverManager was public, in org.eclipse.jface.text .  Not sure why this was moved to internal, but unless there is another way of accomplishing this with public APIs, this should be considered for promotion back to public – and maybe outside of "text" for reuse in other types of controls?

Reproducible: Always
Comment 1 Dani Megert CLA 2011-01-20 01:38:44 EST
What is your concrete use case?
Comment 2 Mark A. Ziesemer CLA 2011-01-20 09:15:02 EST
(In reply to comment #1)
> What is your concrete use case?

Providing "enrich-able" tooltips on a TreeViewer to display additional "quick" status about the nodes they contain, very similar to the tooltips that are displayed on hover over a server in WST's "Server" view (though its enrichment is limited to allowing the text to be selected and copied).  I'd primarily be interested in framework code to provide method that could be hooked into an action (e.g. the F2 or F6 keybinding) to handle the focus/enrichment, as well as the mouse listener that does the same.

I already have the AbstractHoverInformationControlManager working in a basic case on a Tree, properly displaying tooltips for each node.  However, I seem stuck at providing a "'F2' for focus" or "mouse into" feature.  I certainly can't do it without calling the internal APIs, and even then I'm not sure it's possible due to private/internal method/variable restrictions.  The only sure work-around at the moment seems to be writing my own manager - which seems that it will be a lot of re-work, and wouldn't be the simplest to swap in or out later as AbstractInformationControlManager doesn't have any interfaces that could be shared.

In fact, while the JDT implementation (for Javadoc hovers, etc.) seems to work flawlessly, the WST Server view is a bit buggy, especially when using the "'F6' to focus".  I routinely get into the state where the tooltips stop appearing at all until I restart Eclipse.  If this "sticky hover" API were made more public, I would think that the WST Server view could also benefit through reuse.
Comment 3 Dani Megert CLA 2011-01-20 09:18:46 EST
>Providing "enrich-able" tooltips on a TreeViewer to display additional "quick"
>status about the nodes they contain,
The current work is in the Text layer implemented for the text editor/viewer. SWT or JFace would have to decide whether they want to provide such support and if so, one could start with the current stuff we have in Text.