Monday, May 23, 2011

Contributing new preference types in the Eclipse export preferences page

Someone asked me today how he could extend the "Export Preferences" page in Eclipse and add an option to export his own kind of preferences other than whats given in the default. He didn't know the name of the extension, and neither did I at the top of my head. This is what the export preferences page looks like:
This can be opened by right clicking on a project in Package Explorer > Export > Preferences.

I did some digging around to find out how the Java Development Tools (JDT) project contributes the Java Preference options here. And I found that the extension point "org.eclipse.ui.preferenceTransfer" is actually the one that we need to extend in order to define new preference kinds to export. The following snippet is taken from org.eclipse.jdt.ui project's plugin.xml file:


So if you have new preference kinds you want to export, this is the way to go. You can also peek into JDT/UI's plugin file to explore further.

No comments:

Post a Comment