| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en"> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE> |
| Contributing a property page |
| </TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <h3>Contributing a property page</h3> |
| <P > |
| You can contribute a property page for an object by using the |
| <a href="../reference/extension-points/org_eclipse_ui_propertyPages.html"> <b> org.eclipse.ui.propertyPages</b></a> extension point. |
| An object's property page is invoked using the <b>Properties </b>menu in any |
| view that shows objects, such as the resource navigator view. This menu is available when a single |
| object is |
| selected. </P> |
| <P >The readme tool contributes two property pages.</P> |
| <pre> |
| <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> |
| </pre> |
| <P >When you define a property page, you specify the <b>objectClass</b> for |
| which this page is valid. Objects of this class will include your page |
| when the properties are shown. You may optionally supply a <b>nameFilter</b> |
| that further refines the class. In the readme tool example, both pages are contributed for objects of type <b><a href="../reference/api/org/eclipse/core/resources/IFile.html"> IFile</a></b> with a |
| <b>.readme</b> file extension. </P> |
| <P >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. </P> |
| <P > |
| 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.</P> |
| <P > |
| <img src="images/readmeproperties.png" alt="Properties dialog with readme entries" border="0" ></P> |
| |
| |
| |
| |
| </BODY> |
| </HTML> |