Contributing a property page

You can contribute a property page for an object by using the org.eclipse.ui.propertyPages extension point. An object's property page is invoked using the Properties menu in any view that shows objects, such as the resource navigator view.  This menu is available when a single object is selected. 

The readme tool contributes two property pages.

<extension
     point = "org.eclipse.ui.propertyPages">
        <page
           id="org.eclipse.ui.examples.readmetool.FilePage"
           name="%PropertiesPage.filePage"
	   objectClass="org.eclipse.core.resources.IFile"
	   class="org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage"
           nameFilter="*.readme">
        </page>
         <page
            id="org.eclipse.ui.examples.readmetool.FilePage2"
            name="%PropertiesPage.filePage2"
 	   objectClass="org.eclipse.core.resources.IFile"
 	   class="org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage2"
            nameFilter="*.readme">
         </page>
  </extension>

When you define a property page, you specify the objectClass for which this page is valid.  Objects of this class will include your page when the properties are shown.  You may optionally supply a nameFilter that further refines the class.  In the readme tool example, both pages are contributed for objects of type IFile with a .readme file extension.

Property pages are not limited to workbench resources.  All objects showing up in the workbench (even domain-specific objects created by other plug-ins) may have property pages.  Any plug-in may register property pages for any object type.

Property pages look a lot like preference pages, except there is no hierarchy or categorization of property pages. In the dialog below, both readme property pages appear in the main list of pages.

Properties dialog with readme entries