Bugzilla will undergo maintenance 2024-03-29 18h00 CET. Bugzilla will be placed in read-only mode at that time.

Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 423130 - VEX should not register itself as default editor for all .xml file
Summary: VEX should not register itself as default editor for all .xml file
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 1.1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 1.1.0 M4   Edit
Assignee: Florian Thienel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 430343 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-12-04 02:01 EST by Lars Vogel CLA
Modified: 2014-06-09 08:22 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lars Vogel CLA 2013-12-04 02:01:32 EST
Currently VEX registers itself as default editor for all xml files. This is really annoying, e.g. for pom.xml or Android layout files. I suggest to remove this default registration and leave it to the user to open the "right" editor, via right-click -> Open With
Comment 1 Florian Thienel CLA 2014-03-12 14:51:52 EDT
I suspected that the root cause of this is in the plugin.xml, but it's not. Vex registers itself for every document that is created through our wizard using the method org.eclipse.vex.ui.internal.wizards.NewDocumentWizard.registerEditorForFilename(String, String)
Comment 2 Florian Thienel CLA 2014-03-14 14:35:39 EDT
*** Bug 430343 has been marked as a duplicate of this bug. ***
Comment 3 Florian Thienel CLA 2014-03-14 15:01:53 EDT
https://git.eclipse.org/r/#/c/23405/
Comment 4 Florian Thienel CLA 2014-03-16 09:05:32 EDT
Eric, can you please verify the bugfix using the latest version from our continuous build?

https://hudson.eclipse.org/vex/job/mylyn-docs-vex.ci/lastSuccessfulBuild/artifact/org.eclipse.vex.repository/target/repository
Comment 5 Eric Duell CLA 2014-03-17 03:00:41 EDT
@Florian: I tried, but when I try to install the plugin it now complains that my org.eclipse.ui is too low. I have 3.104.0.v20121024-145224. I will use my keplar installation for testing.

Eclipse SDK
Version: 4.2.2
Build id: M20130204-1200
Cannot complete the install because one or more required items could not be found.
  Software being installed: Vex SDK 1.1.0.z201403141859 (org.eclipse.vex.sdk.feature.feature.group 1.1.0.z201403141859)
  Missing requirement: Vex DocBook 1.1.0.z201403141859 (org.eclipse.vex.docbook 1.1.0.z201403141859) requires 'bundle org.eclipse.ui [3.105.0,4.0.0)' but it could not be found
  Cannot satisfy dependency:
    From: Visual Editor for XML 1.1.0.z201403141859 (org.eclipse.vex.feature.feature.group 1.1.0.z201403141859)
    To: org.eclipse.vex.docbook [1.1.0.z201403141859]
  Cannot satisfy dependency:
    From: Vex SDK 1.1.0.z201403141859 (org.eclipse.vex.sdk.feature.feature.group 1.1.0.z201403141859)
    To: org.eclipse.vex.feature.feature.group [1.1.0.z201403141859]
Comment 6 Eric Duell CLA 2014-03-17 06:37:45 EDT
Ok, I used the latest keplar (had to reinstall it after a crash -_-). After installing the latest plugin (jenkins build) I switched to the VEX perspective, switched batck to the Java perspective and the pom.xml now still opens with the default editor. Thats great so far, but all my other xml files are associated with the vex editor. If I switch to the VEX perspective even .classpath and .project files are associated with VEX.

I now can still set my xml editor as the default editor, but that already worked before (Window --> Preferences --> General --> Editors --> Files Associations).
Comment 7 Florian Thienel CLA 2014-03-18 02:41:36 EDT
@Eric: Thank you for the feedback, I'll look deeper into it. That Vex feels responsible for .project and .classpath is really strange - but I can also reproduce this in a clean environment (fresh workspace and configuration).
Comment 8 Florian Thienel CLA 2014-03-19 15:46:54 EDT
I digged further into the content type inference logic implemented in ContentTypeCatalog. It seems that the best solution would be to implement an IContentDescriber which matches only for doctypes registered via the extension point org.eclipse.vex.doctypes. 

At a first glance we may inherit from XmlContentDescriber and get "inspired" by XMLRootElementContentDescriber2.
Comment 9 Florian Thienel CLA 2014-03-20 17:22:40 EDT
https://git.eclipse.org/r/#/c/23677/
Comment 10 Florian Thienel CLA 2014-03-23 06:10:38 EDT
@Eric: There is a new bugfix availble on our master branch now. Could you please try again, if this now works as you expect it?

To associate Vex with files, we now use an own implementation of IContentDescriber. This describer matches only XML documents for which a document type is registered as extension to o.e.vex.ui.doctypes.
Comment 11 Florian Thienel CLA 2014-06-09 08:22:15 EDT
fixed