Bug 215473 - [navigation] Show more then one hyperlink per modifier key
Summary: [navigation] Show more then one hyperlink per modifier key
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.4 M6   Edit
Assignee: Benno Baumgartner CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-16 08:44 EST by Benno Baumgartner CLA
Modified: 2008-03-11 07:24 EDT (History)
5 users (show)

See Also:
daniel_megert: review+


Attachments
fix (45.96 KB, patch)
2008-01-31 04:04 EST, Benno Baumgartner CLA
no flags Details | Diff
fix (43.72 KB, patch)
2008-02-11 10:28 EST, Benno Baumgartner CLA
no flags Details | Diff
fix (63.95 KB, patch)
2008-02-14 10:38 EST, Benno Baumgartner CLA
no flags Details | Diff
Adjusted fix (15.73 KB, text/plain)
2008-02-18 11:44 EST, Dani Megert CLA
no flags Details
fix (55.33 KB, patch)
2008-02-20 08:30 EST, Benno Baumgartner CLA
no flags Details | Diff
fix (34.82 KB, patch)
2008-02-28 06:39 EST, Benno Baumgartner CLA
no flags Details | Diff
Link Style (1.52 KB, text/plain)
2008-02-28 09:14 EST, Benno Baumgartner CLA
no flags Details
fix (37.07 KB, patch)
2008-03-04 10:58 EST, Benno Baumgartner CLA
no flags Details | Diff
fix (37.21 KB, patch)
2008-03-11 06:47 EDT, Benno Baumgartner CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benno Baumgartner CLA 2008-01-16 08:44:02 EST
I20080108-1320

If more then one hyperlink exist on a given position only the first detected hyperlink is opened when clicking on the hyperlink region. Which one the first is is not specified. If we detect more then one hyperlink we should:

- Show each in a hover, the user can open each one when clicking on it in the hover
- Allow to specify on the preference page which hyperlink is opened when clicking on the hyperlink region (the default hyperlink)
Comment 1 Benno Baumgartner CLA 2008-01-31 04:04:21 EST
Created attachment 88383 [details]
fix

Work in progress. I'm almost there, needs polish, NLSing, need to think some more about user defined modifier keys.
Comment 2 Benno Baumgartner CLA 2008-01-31 04:05:28 EST
No way this is going to make it into M5. Sorry.
Comment 3 Dani Megert CLA 2008-01-31 04:07:14 EST
Agreed.
Comment 4 Benno Baumgartner CLA 2008-02-11 10:28:34 EST
Created attachment 89409 [details]
fix

Dani, I would like to fix this in two steps:
1. allow to present multiple hyper links in a pop up
2. allow to configure the default hyper link if multiple available

This will also make it easier for you to review. ok?

This patch fixes 1. Please review, it's pretty simple... You can test it by having an externalized string and set the java element and the properties key hyperlink  to a common modifier.
Comment 5 Benno Baumgartner CLA 2008-02-14 10:38:08 EST
Created attachment 89737 [details]
fix

The same, but this fix shares the AbstractInformationControl with the fix for bug 208165. Which makes the LinkListInformationControl much simpler.
Comment 6 Dani Megert CLA 2008-02-18 11:42:09 EST
Good start!

I've committed all code except for the MultipleHyperlinkPresenter and where it's referenced.

The main problem is that the link "hover" stays alive too long, e.g. when releasing the modifier it should go away and that the first look should be like a hover and not like a focused hover.
Comment 7 Dani Megert CLA 2008-02-18 11:44:56 EST
Created attachment 89992 [details]
Adjusted fix

This patch adjusts the presenter to the changes made to the AbstractInformationControl (see bug 208165) and takes the committed code into account.
Comment 8 Benno Baumgartner CLA 2008-02-20 08:30:56 EST
Created attachment 90174 [details]
fix

(In reply to comment #6)
> The main problem is that the link "hover" stays alive too long, e.g. when
> releasing the modifier it should go away and that the first look should be like
> a hover and not like a focused hover.

Fixed. This patch has following 'issues':
- AbstractInformationControlManager#setInformationControlReplacer is changed from default to protected
- Code to compute the text area of a text region is copied from TextViewerHoverManager, maybe this can be abstracted or moved to a Utility class.
- StickyHoverManager is made API

I don't know if this was the intension from the beginning. It's certainly useful. Otherwise the MultipleHyperlinkPresenter could be moved to the jface.text package.

As a side note: IMHO the hover could need some colors, it looks a bit boring at the moment.
Comment 9 Dani Megert CLA 2008-02-20 09:25:01 EST
>- StickyHoverManager is made API
This is 100% no go. Please talk to Markus about another solution.
Comment 10 Benno Baumgartner CLA 2008-02-28 06:39:33 EST
Created attachment 90984 [details]
fix

That's much better: Fix without using the StickyHoverManager.

The manager also makes sure, that the multiple hyperlink hover wins over text hovers if there is a conflict.

The multiple hyperlinks are shown in a menu like way, and not as links. I think this looks much better then the yellowish hover approach: It is not a hover, it's more like an automatic popup menu. Give it a try. But I can change it easily if you fell very strong about this.

The order of the hyperlinks is (although not specified) the order of the hyperlink detector contributions in the plugin.xml. I've checked that the NLS detector is prior to the Java element one.
Comment 11 Benno Baumgartner CLA 2008-02-28 06:42:38 EST
Oh and I've added this internal TextUtils class. I'm not sure if you want to move this to TextUtilities and make it API...
Comment 12 Benno Baumgartner CLA 2008-02-28 09:14:14 EST
Created attachment 90996 [details]
Link Style

use this to get the link style
Comment 13 Dani Megert CLA 2008-02-29 10:11:06 EST
Patch needs to adopt new FillLayout from parent class. Otherwise it looks good but I don't like the look. It should either be:
- browser widget with links
- quick view look

Please move the methods from the TextUtils to JFaceTextUtil but make getAverageCharWidth(...) take a control to make it more useful.
Comment 14 Eugene Kuleshov CLA 2008-02-29 11:08:01 EST
(In reply to comment #13)
> It should either be:
> - browser widget with links
> - quick view look

Daniel, is there a plan to support keyboard-based navigation for links? I really hope so, but then browser widget would be really inconvenient, because it only support Tab/Enter navigation trough the link list.
Comment 15 Benno Baumgartner CLA 2008-03-04 10:58:20 EST
Created attachment 91522 [details]
fix

Using a table with quick view behavior and info background. I still think a white background would look nicer.
Comment 16 Benno Baumgartner CLA 2008-03-11 06:47:01 EDT
Created attachment 92145 [details]
fix

- Does not use style label provider
- Does release token if link is opened
Comment 17 Dani Megert CLA 2008-03-11 07:23:45 EDT
Committed the patch to HEAD.
Available in builds >= I200811-0800.

>- Allow to specify on the preference page which hyperlink is opened when
>clicking on the hyperlink region (the default hyperlink)
This can get quite complicated especially if we not only want to set the default but also the sequence in the list. For now we will try a LRU approach (see bug 222212). If this turns out to be impractical we can try to address bug 220288.

Remaining issues:
bug 222208: Should leave link style presentation when going to link list
bug 222210: Improve Java element hyperlinking if resolved to > 1 element
bug 222212: [navigation] Add LRU strategy to MultipleHyperlinkPresenter

>Daniel, is there a plan to support keyboard-based navigation for links? 
See bug 78522 but I'm not yet sure whether we find time for this for 3.4. Note that we will not use the Browser widget.