Eclipse #201116 contentMergeViewers discarded

I filled Bug 201116 – Compare will silently discard additional contentMergeViewers associated with the same file extension a couple of days ago. As Szymon Brandys says eclipse should allow the user to switch between the differente merge viewer available for a given extension. He proposes two solutions: Having a mechanishm inside the compare view to do the switch or having a preference page to do the same I feel more inclined towards the second solution, as I’m used to change the defautl editor for .xml, etc though the preference page General -> Editors -> File Associations. Having a similar preference page would fit me. I’m trying to figure out how to integrate a preference page to org.eclipse.compare and send it back to eclipse.org to include it in the next release.

August 31, 2007

Eclipse Preference Page Extension Wizard troubleshooting

Today I tried to add a Preference Page to an RCP application that I’m working on with no luck. After executing the Extension -> Add -> Extension Wizards -> Preference Page I end up with 3 new classes. But 2 of then have compilation errors, they refer to an unexisting PreferenceClass. After googling a bit I found this message in a mailing list describing the same exact problem: >Hello, I ’ve added preference page in my application using plugin.xml extensions template. Then, in a new package, Eclipse created 3 classes (Template preferences page extending FieldEditorPreferencePage, a preference constants class and a preference initializer class). The template preferences page uses a PreferenceClass which doesn’t already exists… I suppose this class has to initialize the preference store, in the preference template class constructor, unsing the plugin instance of the product : “setPreferenceStore(PreferenceClass.getDefault().getPreferenceStore());” I’ve tried to extend the AbstractUIPlugin (I’ve read in differents articles from eclipse.org) to catch the plugin instance when it is created, but without succes (when to catch this single instance during startup of eclispe core runtime ?). Then I’ve found the existance of the WorkBenchPlugin class which holds this static instance, I used it, discarding PreferenceClass , but Eclispe tells me that the use of this class is discouraged. Why ? How is it possible to store the plugin instance at startup ? Thanks a lot for your help, frank ...

June 29, 2007