This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I would like to propose an extension to the Editor Hyperlink SPI. The extension is twofold: -allow providers to specify a tooltip (showing specification of the hyperlink target). -allow more than one gesture (Hyperlink Type), eg. go to declaration and go to source. Currently, the only supported gesture is go to declaration, but the SPI allows to introduce new gestures. Diff is attached.
Created attachment 48657 [details] Proposed change - API part.
Created attachment 48658 [details] Proposed change - full, including implementation.
VV1: Javadoc for HyperlinkProviderExt.getTooltipText what is the text formatting supported for tooltip string? html? Does it need <html>...</html>?
VV2: We'd like to use this provider to display macros definition, macros in C/C++ are often multiline objects like function definition. Would it be correctly displayed in tooltip without cutting text off?
VV2: The tooltip text will most likely be truncated. See also issue #99191.
VV2: truncated tooltip is not really appropriate for us. Is there a chance to show it completely? We plan to provide multi line string. VV3: Is it possible for tooltip to be shown on top of all windows, not truncated by parent-window right/left borders? Seems, it is not problem of this IZ, rather ((ExtEditorUI) ui).getToolTipSupport().setToolTip
to VV3: Btw, Navigator component's tooltip overlap window border when shows it's tooltip for element, so it's doable :-)
Right now, I am working on rewriting the impl. to use the HighlightsLayer infrastructure to both paint the hyperlink and provide the tooltip. The hyperlinks will then inherit the features of the Highlights-based tooltips. You should be able to separate lines with '\n', but currently, if a line is too long, it will be truncated.
VV4: Btw, what is the behavior in debug mode? Do you plan to disable this kind of tooltips or debuggers will register hight priority tooltip provider? Two tooltips (with value and declaration) is not fine.
VV4: Debuger provides its tooltips through Annotations registered in <mime-type>/ToolTips and they have priority over the tooltips from highlighting layers.
Integrated. The highlight layers are used to provide the tooltips. Both HTML and non-HTML tooltips can be used. Start the tooltip with "<html>" to get HTML tooltip. Checking in libsrc/org/netbeans/lib/editor/hyperlink/spi/HyperlinkType.java; /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/spi/HyperlinkType.java,v <-- HyperlinkType.java new revision: 1.2; previous revision: 1.1 done RCS file: /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/spi/HyperlinkProviderExt.java,v done Checking in libsrc/org/netbeans/lib/editor/hyperlink/spi/HyperlinkProviderExt.java; /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/spi/HyperlinkProviderExt.java,v <-- HyperlinkProviderExt.java initial revision: 1.1 done Checking in libsrc/org/netbeans/lib/editor/hyperlink/HyperlinkOperation.java; /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/HyperlinkOperation.java,v <-- HyperlinkOperation.java new revision: 1.14; previous revision: 1.13 done RCS file: /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/HyperlinkProviderManagerExt.java,v done Checking in libsrc/org/netbeans/lib/editor/hyperlink/HyperlinkProviderManagerExt.java; /cvs/editor/libsrc/org/netbeans/lib/editor/hyperlink/HyperlinkProviderManagerExt.java,v <-- HyperlinkProviderManagerExt.java initial revision: 1.1 done Checking in lib/apichanges.xml; /cvs/editor/lib/apichanges.xml,v <-- apichanges.xml new revision: 1.10; previous revision: 1.9 done Checking in libsrc/META-INF/services/org.netbeans.spi.editor.mimelookup.Class2LayerFolder; /cvs/editor/libsrc/META-INF/services/org.netbeans.spi.editor.mimelookup.Class2LayerFolder,v <-- org.netbeans.spi.editor.mimelookup.Class2LayerFolder new revision: 1.2; previous revision: 1.1 done Checking in lib/nbproject/project.properties; /cvs/editor/lib/nbproject/project.properties,v <-- project.properties new revision: 1.22; previous revision: 1.21 done