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

Bug 298364

Summary: task hyperlink duplicates the platform's URL hyperlink
Product: z_Archived Reporter: Jesper Moller <jesper>
Component: MylynAssignee: Steffen Pingel <steffen.pingel>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P1 CC: mik.kersten, steffen.pingel
Version: 3.2   
Target Milestone: 3.4   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Screenshot showing 4 (four) ways of linking to the same URL.
none
proposed changes
none
mylyn/context/zip
none
screenshot of Java editor
none
updated patch none

Description Jesper Moller CLA 2009-12-21 18:57:41 EST
Created attachment 154908 [details]
Screenshot showing 4 (four) ways of linking to the same URL.

I'm attaching a screen capture of an XML file editing (XML Schema, in fact)  situation where I'm Ctrl-hovering over a URI and four different possible hyperlinks are shown:
1. Set As Focus
2. Open 'http://java.sun.com/xml/ns/persistence/orm_1_0.xsd' in a browser 
3. Open 'http://java.sun.com/xml/ns/persistence/orm_1_0.xsd' in a browser 
4. Open 'http://java.sun.com/xml/ns/persistence/orm_1_0.xsd'

The hyperlinks are from the following providers:
1 is supplied by the XSD UI plugin, and will correctly navigate to the ORM Schema (at least it will once bug  271965 is fixed)
2 is supplied by the platform and will open the URL in a browser editor.
3 is supplied by Mylyn and will open the URL in a browser editor.
4 is supplied by WTP as a catalog hyperlink, since the URL matches an entry in the system catalog, supplied by JST, and will open in an XML editor. This is unclear and is addressed in bug 298363.

As a user, this is really confusing - and following a link always involves surprises: Why is the link for Mylyn and from the platform identical, and what purpose does it fill - I mean, this is with just the local tasks and Bugzilla installed.

My suggestion is to generate fewer hyperlinks if they are identical with the platform's, or at least add some disambiguation to the hyperlink text.

I'm opening bugs for the label texts for XSD as well.
Comment 1 Jesper Moller CLA 2009-12-23 20:01:04 EST
FYI: Regarding link 1, I've commented in bug 271968.
Comment 2 Steffen Pingel CLA 2009-12-23 20:27:15 EST
The advantage of the Mylyn URL hyperlink detector is that it is capable of opening task hyperlinks in a rich editor rather than the web browser. I can see however that that gets in the way when editors support multiple hyperlinks particularly if they perform identical actions. 

For now I would suggest to disable the Task URLS detector in the preferences under General > Editors > Text Editors > Hyperlinking. 

To improve this in a future release I'll investigate if it's possible to only activate the Mylyn hyperlink detector for actual task urls that open in a rich editor and change the hyperlink text accordingly, e.g. "Open task xyz in a Task Editor". If not, we can consider to limit the scope of the task URL hyperlink editor to the Task Editor since the platform's URL hyperlink detector is active by default for text editors.
Comment 3 Steffen Pingel CLA 2010-01-27 12:40:25 EST
Created attachment 157424 [details]
proposed changes
Comment 4 Steffen Pingel CLA 2010-01-27 12:40:28 EST
Created attachment 157425 [details]
mylyn/context/zip
Comment 5 Steffen Pingel CLA 2010-01-27 12:41:24 EST
Created attachment 157426 [details]
screenshot of Java editor
Comment 6 Steffen Pingel CLA 2010-01-27 13:09:03 EST
The patch changes the behavior of the Mylyn URL hyperlink detector in the following way:

* In text editors it only returns a hyperlink when a detected URL matches a URL of a task present in the task list. The message makes it explicit that the URL will be opened in the task editor (see screenshot). Task URLs that point to tasks not in the task list are ignored and will be handled by the standard platform detector which opens URLs in a browser.
* In the task editor the behavior is unchanged. All URLs are handled by Mylyn's URL hyperlink detector and the platform detector is disabled.

Mik, are you okay with committing this change?
Comment 7 Jesper Moller CLA 2010-01-27 16:54:01 EST
I tried the patch against your 3.2.2 version and works great!
Comment 8 Steffen Pingel CLA 2010-01-29 13:27:27 EST
We discussed this on yesterday's call and will go ahead with the proposed change with a slight modification: In addition to handling all known URLs the hyperlink detector will also handle URLs that are prefixed with a known task repository URL, e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=298364 if the user has the Eclipse.org repository configured which has the URL https://bugs.eclipse.org/bugs.
Comment 9 Steffen Pingel CLA 2010-02-07 19:37:45 EST
Created attachment 158401 [details]
updated patch
Comment 10 Steffen Pingel CLA 2010-02-07 19:38:39 EST
Patch committed to head. The change will be in the 3.4.0 weekly builds and the next Helios milestone.
Comment 11 Jesper Moller CLA 2010-08-23 20:22:56 EDT
Thanks for fixing this, hereby closing.