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.

Bug 115359

Summary: Hyperlink SPI extension
Product: editor Reporter: Jan Lahoda <jlahoda>
Component: -- Other --Assignee: apireviews <apireviews>
Status: RESOLVED FIXED    
Severity: blocker CC: vv159170
Priority: P3 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Proposed change - API part.
Proposed change - full, including implementation.

Description Jan Lahoda 2007-09-12 15:16:02 UTC
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.
Comment 1 Jan Lahoda 2007-09-12 15:16:58 UTC
Created attachment 48657 [details]
Proposed change - API part.
Comment 2 Jan Lahoda 2007-09-12 15:17:37 UTC
Created attachment 48658 [details]
Proposed change - full, including implementation.
Comment 3 Vladimir Voskresensky 2007-09-14 06:15:52 UTC
VV1: Javadoc for HyperlinkProviderExt.getTooltipText
what is the text formatting supported for tooltip string? html?
Does it need <html>...</html>?
Comment 4 Vladimir Voskresensky 2007-09-14 06:43:30 UTC
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?
Comment 5 Vitezslav Stejskal 2007-09-14 07:39:58 UTC
VV2: The tooltip text will most likely be truncated. See also issue #99191.
Comment 6 Vladimir Voskresensky 2007-09-14 09:15:58 UTC
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 
Comment 7 Vladimir Voskresensky 2007-09-14 09:20:15 UTC
to VV3: Btw, Navigator component's tooltip overlap window border when shows it's tooltip for element, so it's doable :-)
Comment 8 Jan Lahoda 2007-09-14 09:37:18 UTC
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.
Comment 9 Vladimir Voskresensky 2007-09-14 09:49:03 UTC
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.
Comment 10 Vitezslav Stejskal 2007-09-14 12:29:27 UTC
VV4: Debuger provides its tooltips through Annotations registered in <mime-type>/ToolTips and they have priority over
the tooltips from highlighting layers.
Comment 11 Jan Lahoda 2007-09-20 08:25:39 UTC
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