I'm porting an application from eclipse 3 to eclipse 4 and the main problem now is with the toolbars. The toolbars should be visible or not depending by the element selected in the editor (not only the type, but many other check).
The toolbars are contributed on the org.eclipse.ui.menus extension point with many children toolbar elements and then one or more control elements. This control must extends WorkbenchWindowControlContribution.
The problem is that on eclipse 3.8 the isVisible method of the controls is called to know if the control is visible and then call the method createControls. In eclipse 4 the method createControls is called directly.
I tought i must use the visibleWhen on the control but i don't know how to set something like "call this method to check if this element is visible" and evaluate it everytime the selection change.