|
|
|
Re: Enable action in menubar? [message #1047489 is a reply to message #532893] |
Tue, 23 April 2013 05:23  |
Eclipse User |
|
|
|
I just had the same problem and found out the following:
Enabling or disabling an Action is trivial as long as the method isEnabled() is not overwritten. Just call setEnabled(true) or setEnabled(false) to disable an Action. This fires a property change event for the ENABLED property if the enabled state actually changes as a consequence. A problem occurs if the method isEnabled() is overwritten, because when calling setEnabled the framework checks if the value of enabled will change by calling isEnabled.
If isEnabled() has to be overwritten anyway, the property change event is not fired when calling setEnabled().
So you have to fire this event explicitely by calling firePropertyChange(ENABLED, !isEnabled(), isEnabled());
|
|
|
Powered by
FUDForum. Page generated in 0.05129 seconds