blob: 527a1138f2b04dc682e65867a16b5078bdb7f858 [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML>
<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>Part interfaces</title>
</HEAD>
<BODY BGCOLOR="#ffffff">
<div style="margin-left: 40px;">
<h2>Part interfaces</h2>
<p>Parts do not need to implement any particular interface or inherit from any
particular base class. However, parts may optionally implement certain interfaces
in order to receive callbacks from their parent. For example, if a part implements
the IFocusable interface then its parent will use that interface to give focus
to the part. Parts are allowed to either implement the interface directly
or implement IAdaptable and provide an adapter for the interface.<br>
<br>
Similarly to site interfaces, part interfaces are registered in the <span
style="font-style: italic;">org.eclipse.core.component.types </span>extension
point. There is a slight difference in the XML markup to distinguish between
a site interface and a part interface. Any plugin can extend the set of interfaces
available for a view to implement, and the PDE plugin registry can be used
to find all such interfaces.<br>
<br>
The workbench provides the following interfaces to be implemented by parts:
</p>
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; font-weight: bold;">Interface<br> </td>
<td style="vertical-align: top; font-weight: bold;">Description<br> </td>
</tr>
<tr>
<td style="vertical-align: top;">IFocusable<br> </td>
<td style="vertical-align: top;">Allows the part to implement setFocus.<br>
</td>
</tr>
<tr>
<td style="vertical-align: top;">IPersistable<br> </td>
<td style="vertical-align: top;">Allows the part to save its state between
sessions.<br> </td>
</tr>
<tr>
<td style="vertical-align: top;">IMultiPart<br> </td>
<td style="vertical-align: top;">Indicates that the part has the notion
of an active child.<br> </td>
</tr>
<tr>
<td style="vertical-align: top;">ISite<br> </td>
<td style="vertical-align: top;">Although this is never actually implemented
by a part, the implementations of other part interfaces can depend on
ISite in order to gain access to their site.<br> </td>
</tr>
</tbody>
</table>
<br>
Parts may also implement lifecycle interfaces. Lifecycle interfaces are different
from regular part interfaces in several ways:
<ul>
<li>A lifecycle interface must be implemented directly (it cannot be provided
as an adapter);</li>
<li>Any or all of a part's dependencies may also implement the lifecycle interface;</li>
<li>When a lifecycle notification is sent to a part, it is also sent to all
of the part's dependencies;</li>
<li>Lifecycle interfaces are hardcoded, and are not registered with an extension
point.<br>
</li>
</ul>
Parts support the following lifecycle interfaces:<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
cellspacing="2">
<tbody>
<tr>
<td style="vertical-align: top; font-weight: bold;">Interface<br> </td>
<td style="vertical-align: top; font-weight: bold;">Description<br> </td>
</tr>
<tr>
<td style="vertical-align: top;">IDisposable<br> </td>
<td style="vertical-align: top;">Receives a notification when the component
is disposed.<br> </td>
</tr>
<tr>
<td style="vertical-align: top;">INestedComponent<br> </td>
<td style="vertical-align: top;">Implemented by children of a multiplexer.
Receives activate and deactivate messages when the active part changes.<br>
</td>
</tr>
</tbody>
</table>
<br>
<br>
</div>
</BODY>
</HTML>