Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » How to change enablement state of ControlContribution(Updating toolbar has no effect)
How to change enablement state of ControlContribution [message #997489] Mon, 07 January 2013 18:45
Mark Leone is currently offline Mark LeoneFriend
Messages: 69
Registered: April 2012
I have a ControlContribution that I've added to a ToolBar in a ViewPart. I want to change its enabled state depending on the state of a resource known to the ViewPart code. I tried passing the ControlContribution item a reference to the view, and overriding the enablement method, like this:

public boolean isEnabled() {
   return this.myView.isResourceReady();

But I don't know how to tell the ToolBarManager that the resource status has changed. Whenever it changes, I call


but this doesn't change the enablement state of the ControlContribution--it's always enabled.

I also tried calling


when I cerate controlContribution. This makes it not visible, but then there is no way to make it visible when the resource status changes. I invoke


But controlContribution does not become visible.
Previous Topic:How to display ToolTip on Mouse Hover over VerticalRuler
Next Topic:How alignment done in this UI
Goto Forum:

Current Time: Mon May 30 12:59:20 GMT 2016

Powered by FUDForum. Page generated in 0.02139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software