|Re: can not deactivate handler (only toolbar) [message #892820 is a reply to message #891448]
||Fri, 29 June 2012 21:56
|| Simon Scholz
Registered: April 2012
yuta kobayashi wrote on Mon, 25 June 2012 04:15|
(in IPerspectiveListener4#perspectiveOpened, does not work well)
This depends on what you actually want to achieve with the listener.
You did not mention, what your aim is, when the IPerspectiveListener3#perspectiveOpened listener is invoked.
But the IPerspectiveListener3#perspectiveOpened is only invoked if a perpective is added to the org.eclipse.ui.internal.WorkbenchPage and not if it is already opened and the user activates the perspective.
@see WorkbenchPage#addPerspective(Perspective persp)
@see WorkbenchPage#createPerspective(PerspectiveDescriptor desc, boolean notify)
Only those two methods invoke the firePerspectiveOpened method of the org.eclipse.ui.internal.WorkbenchWindow
yuta kobayashi wrote on Mon, 25 June 2012 04:15
However, I can not understand why "re-evaluation" is necessary for only toolbar.
I think the performance of the Client would lack, if the PropertyTester would be tested all the time.
But that would be necessary, if you want the handler´s state to be updated out of the box, because the toolbar is always visible to the user.
Concerning a menu the state is evaluated, when the user opens the menu, but the toolbar is kind of "always opened" and there is not user action to be done in order to see the toolbaritem.
So the developer is reponsible to update the state by using the IEvaluationService, like Paul Webster explained.
Is that correct Paul?
Powered by FUDForum
. Page generated in 0.01847 seconds