Within the workbench there are many views which track the active part. If a part is activated these views display some properties for the active part. A simple example is the Outline View
, which displays the outline for the active editor. To avoid loss of context when part activation changes, these views may implement a multi-page approach. A separate page is maintained within the view for each source view. If a part is activated the associated page for the part is brought to top. If a part is closed the associated page is disposed. PageBookView
is a base implementation for multi page views.
PageBookView
s provide an IPageSite
for each of their pages. This site is supplied during the page's initialization. The page may supply a selection provider for this site. PageBookView
s deal with these selection providers in a similar way to a workbench page's SelectionService
. When a page is made visible, if its site has a selection provider, then changes in the selection are listened for and the current selection is obtained and fired as a selection change event. Selection changes are no longer listened for when a page is made invisible.
This class should be subclassed by clients wishing to define new multi-page views.
When a PageBookView
is created the following methods are invoked. Subclasses must implement these.
createDefaultPage
- called to create a default page for the view. This page is displayed when the active part in the workbench does not have a page.getBootstrapPart
- called to determine the active part in the workbench. A page will be created for this partWhen a part is activated the base implementation does not know if a page should be created for the part. Therefore, it delegates creation to the subclass.
isImportant
- called when a workbench part is activated. Subclasses return whether a page should be created for the new part.doCreatePage
- called to create a page for a particular part in the workbench. This is only invoked when isImportant
returns true.When a part is closed the base implementation will destroy the page associated with the particular part. The page was created by a subclass, so the subclass must also destroy it. Subclasses must implement these.
doDestroyPage
- called to destroy a page for a particular part in the workbench.
|
|