Changing visibility of the toolbar items in IViewPart [message #631547] |
Thu, 07 October 2010 18:13  |
Eclipse User |
|
|
|
I ran into the following problem:
There are several editors (IEditorParts) in the app. There is also an
IViewPart that has a toolbar with several items. The IViewPart provides
supplementary content for some, but not all editors.
When an unsupported editor becomes active, the IViewPart goes empty.
However, its toolbar remains populated. I need to empty it out as well.
I tried the PropertyTester, wired up the plugin.xml, to control the
visibility of the commands, among other things, but no matter what I
tried, the toolbar items' status was updated only when the IViewPart
became active. The problem is that I need the toolbar refreshed as the
editors become active/inactive; the IViewPart may never gain focus.
Is there any solution based on the documented framework features (as
opposed to possible hacks)?
Alex Molochnikov
Kelman Technologies Inc.
|
|
|
|
|
Re: Changing visibility of the toolbar items in IViewPart [message #631764 is a reply to message #631658] |
Fri, 08 October 2010 11:41  |
Eclipse User |
|
|
|
Thank you, Paul. I am aware of this. However, my problem is in timing of
the testing. It does not fire until the IViewPart that owns the toolbar
gains focus. Hence there is no change in the toolbar status (items
adder/removed, enabled/disabled) when IEditorParts change their state.
Alex Molochnikov
Paul Webster wrote:
> If you are using propertyTesters, remember they are not event driven. If
> you need to re-evaluate a property tester because you think it might
> have changed, use
> org.eclipse.ui.services.IEvaluationService.requestEvaluation (String)
>
> PW
>
|
|
|
Powered by
FUDForum. Page generated in 0.26891 seconds