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

Bug 298363

Summary: [ui]Catalog hyperlink detector quite confusing
Product: [WebTools] WTP Source Editing Reporter: Jesper Moller <jesper>
Component: wst.xmlAssignee: Nick Sandonato <nsand.dev>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: itewksbu, nsand.dev
Version: 3.2   
Target Milestone: 3.3 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Screenshot showing 4 (four) ways of linking to the same URL.
none
String Patch
none
Patch to show the name of Editor for Catalog url
none
patch none

Description Jesper Moller CLA 2009-12-21 18:48:57 EST
Created attachment 154907 [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.

As a user, this is really confusing - and following a link always involves surprises.

My suggestion is to add some disambiguation to the hyperlink text, such as "Open 'http://java.sun.com/xml/ns/persistence/orm_1_0.xsd' through the XML catalog".

I'm opening bugs for the label texts for XSD and Mylyn as well.
Comment 1 Jesper Moller CLA 2009-12-22 08:04:19 EST
Regarding link 3, I've posted a bugzilla for this as Bug 298364.
Comment 2 Jesper Moller CLA 2009-12-23 20:00:43 EST
Regarding link 1, I've commented in bug 271968.
Comment 3 Ian Tewksbury CLA 2010-03-12 08:30:33 EST
Created attachment 161874 [details]
String Patch

Changes string from:
Open ''{0}''
to
Open ''{0}'' in XML Editor
Comment 4 Nick Sandonato CLA 2010-04-02 16:15:11 EDT
Though small, it's a modified string. We'll have to wait.
Comment 5 Nick Sandonato CLA 2010-04-02 16:19:04 EDT
I also don't think we should explicitly state "XML editor", for example, the .xsd would be opened in the Schema editor.
Comment 6 Jesper Moller CLA 2010-04-02 16:51:46 EDT
(In reply to comment #5)
> I also don't think we should explicitly state "XML editor", for example, the
> .xsd would be opened in the Schema editor.

Actually, the catalog hyperlink code is also a bit imcomplete at the moment. IIRC, it doesn't correctly work with rewrite and suffix entries.
Comment 7 Sarika Sinha CLA 2010-11-26 04:11:41 EST
By platform API we can get the name of the XSD Editor class, InternalXSDMultiPageEditor but the user might expect a commonly used name for the editor in simple language.
Comment 8 Nitin Dahyabhai CLA 2010-12-06 14:17:35 EST
(In reply to comment #7)
> By platform API we can get the name of the XSD Editor class,
> InternalXSDMultiPageEditor but the user might expect a commonly used name for
> the editor in simple language.

org.eclipse.ui.IEditorDescriptor#getLabel() returns soemthing with InternalXSDMultiPageEditor?
Comment 9 Sarika Sinha CLA 2010-12-07 05:27:28 EST
label of EditorDescritor gives the proper name, but when we use org.eclipse.ui.ide.IDE.getEditorDescriptor(IFile) for xsd file, we get XML Editor instead of XSD Editor.
Comment 10 Sarika Sinha CLA 2010-12-23 04:51:59 EST
Created attachment 185754 [details]
Patch to show the name of Editor for Catalog url

DefaultEditor as XSD could not be found in this scenario as "EditorProperty" for these files in jar could not be found. Using the getEditor method of IDE to show the name for Open with as being used while opening. But this opens in XML Editor.
Comment 11 Nick Sandonato CLA 2011-02-25 11:42:48 EST
Created attachment 189826 [details]
patch

As mentioned by Sarika, XSD files were showing XML Editor in their text. This patch should resolve this as well as making it more robust for the various types of hyperlinks.
Comment 12 Nick Sandonato CLA 2011-02-25 11:43:18 EST
Code checked in.