blob: 1d880222049a1201ae70e56579cf77a0fe4dd51e [file] [log] [blame]
<!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.&nbsp; This menu is available when a single
object is
selected.&nbsp;</P>
<P >The readme tool contributes two property pages.</P>
<pre>
&lt;extension
point = &quot;org.eclipse.ui.propertyPages&quot;&gt;
&lt;page
id=&quot;org.eclipse.ui.examples.readmetool.FilePage&quot;
name=&quot;%PropertiesPage.filePage&quot;
objectClass=&quot;org.eclipse.core.resources.IFile&quot;
class=&quot;org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage&quot;
nameFilter=&quot;*.readme&quot;&gt;
&lt;/page&gt;
&lt;page
id=&quot;org.eclipse.ui.examples.readmetool.FilePage2&quot;
name=&quot;%PropertiesPage.filePage2&quot;
objectClass=&quot;org.eclipse.core.resources.IFile&quot;
class=&quot;org.eclipse.ui.examples.readmetool.ReadmeFilePropertyPage2&quot;
nameFilter=&quot;*.readme&quot;&gt;
&lt;/page&gt;
&lt;/extension&gt;
</pre>
<P >When you define a property page, you specify the <b>objectClass</b> for
which this page is valid.&nbsp; Objects of this class will include your page
when the properties are shown.&nbsp; You may optionally supply a <b>nameFilter</b>
that further refines the class.&nbsp; 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.&nbsp; All objects
showing up in the workbench (even domain-specific objects created by other
plug-ins) may have property pages.&nbsp; 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>