|
Bug in PageBookView??? -
10-07-2009, 05:41 PM
Here's a snippet from the org.eclipse.ui.part.PageBookView Javadoc:
* <code>PageBookView</code>s provide an <code>IPageSite</code> for each of
* their pages. This site is supplied during the page's initialization. The page
* may supply a selection provider for this site. <code>PageBookView</code>s
* deal with these selection providers in a similar way to a workbench page's
* <code>SelectionService</code>. 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.
And indeed PageBookView's SelectionProvider redirects calls to getSelection() and setSelection() to the SelectionProvider of the current (visible) page's site. However, calls to addSelectionChangedListener() and removeSelectionChangedListener() only add listeners to, and remove from, PageBookView's own SelectionManager and no listeners are added to the current page's SelectionProvider. Consequently, the page's SelectionProvider cannot generate selection events (no listeners to notify of selection changes).
Is this a bug or am I missing something? How can the "changes in the selection be listened for" if there is no listeners to listen for them?
Thanks!
|