|
Re: How to get the correct zoomManger when using a MultiPageEditorPart [message #197126 is a reply to message #197089] |
Thu, 29 September 2005 18:41 |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Create your own MultiPageZoomManager, and call setPage(ZoomManager delegate)
when you switch pages. Then fire zoom level property changed event and the
combo should update.
"Drew" <drew@acm.org> wrote in message news:dhh0sb$2a4$1@news.eclipse.org...
>I have added a ZoomComboContributionItem to the ActionBarContributor for
>the
> MultiPageEditorPart. The ZoomComboContributionItem uses a partListener to
> call setZoomManager based on the partActivated call. Unfortuneatly
> partActivated does not get called when page activation chnages in the
> MultiPageEditorPart. So i get the last active zoomManager .
>
> I dropped a selectListener off the ZoomComboContributionItem and this
> seems
> to work , but seem a bit heavy for this purpose. Any other lighter ideas?
>
> IWorkbenchPage wp = getPage();
> final ZoomComboContributionItem zitem = new ZoomComboContributionItem(wp);
> toolBarManager.add(zitem);
> wp.addSelectionListener( new ISelectionListener()
> {
> // a selection listsner seems a bit heavy
> // for this purpose, but it is one way to
> // get the correct zoomManager after the active page
> // chnages in the MultiPageEditorPart
> public void selectionChanged(IWorkbenchPart part, ISelection selection)
> {
> zitem.setZoomManager((ZoomManager) part.getAdapter(ZoomManager.class));
> }
>
> });
>
>
|
|
|
Re: How to get the correct zoomManger when using a MultiPageEditorPart [message #197139 is a reply to message #197089] |
Thu, 29 September 2005 19:30 |
Eclipse User |
|
|
|
Originally posted by: mvsteenbergen.eljakim.scratch-this.nl
Drew wrote:
> I have added a ZoomComboContributionItem to the ActionBarContributor for the
> MultiPageEditorPart. The ZoomComboContributionItem uses a partListener to
> call setZoomManager based on the partActivated call.
Your ActionBarContributor should be a
MultiPageEditorActionBarContribitor. Then you will get notified whenever
the active page changes (setActivePage() will be called). As far as I
know, this is the simplest solution.
Regards,
Martijn.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04736 seconds