MToolControl.setVisible(true) changes not immediately reflected in status bar [message #1724538] |
Wed, 24 February 2016 13:33 |
Andreas Sewe Messages: 111 Registered: June 2013 |
Senior Member |
|
|
Hi,
I have a Tool Control registered in a model fragment and contributed to the Eclipse IDE's status bar. Now, I want to show & hide the control depending on a preference. At the moment, I am using the following code:
private MToolControl modelElement;
@Inject
public MyToolControl(MToolControl modelElement) {
this.modelElement = modelElement;
}
@Inject
public void setVisible(@Preference(PREF_VISIBLE) boolean visible) {
modelElement.setVisible(visible);
}
This does not quite work, yet, however: When I set PREF_VISIBLE to false, setVisible is called (as expected) and the tool control vanishes from the status bar. If I set PREF_VISIBLE to true again, setVisible is again called, but the UI does not change immediately. Instead, I have to switch focus from the workbench window and back again to case the UI to be updated.
I suspect I need to notify the framework about this model change somehow. What am I missing (and why am I not missing it when it comes to making my MToolControl invisible rather than visible)?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03352 seconds