Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 84237

Summary: generalized hyperlink navigation should have generalized action
Product: [Eclipse Project] Platform Reporter: Amy Wu <for.work.things>
Component: TextAssignee: Platform-Text-Inbox <platform-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Amy Wu CLA 2005-02-02 11:04:33 EST
In 3.1 there is now generalized support for hyperlink navigation in TextViewer 
using IHyperlink, IHyperlinkDetector, IHyperlinkPresenter, HyperlinkManager.  
There should also be a generalized menu action that performs the same 
function.  Specifically F3, which is already used by some editors to open 
declaration, source, etc.

This action should be able to reuse the IHyperlink* objects.  Perhaps create a 
texteditoraction that gets the HyperlinkManager or just all HyperlinkDetectors 
from the editor.  Then when F3 is pressed, detect hyperlinks at the current 
cursor position and open the hyperlink.

When I tried to implement this myself, I ran into a problem since you need to 
pass the textViewer to IHyperlinkDetector.detectHyperlinks() and textviewer is 
hard to get access to unless you are in the editor.  It would be easier if you 
only need to pass IDocument to IHyperlinkDetector.detectHyperlinks().
Comment 1 Dani Megert CLA 2005-02-02 11:54:54 EST
We normally pass ITextViewer in JFace Text APIs.
IHyperlinkDetector.detectHyperlinks(...) is called by the framework and hence
the viewer is provided for you. If you want to use the IHyperlinkDetector in a
different context you can pass (and later use in detectHyperlinks(...)) whatever
you want when constructing the hyperlink detector.


*** This bug has been marked as a duplicate of 78522 ***