canExecute of contributed HandledToolItem isn't always called [message #1385257] |
Thu, 05 June 2014 08:45 |
Ozgur Cagdas Messages: 32 Registered: May 2013 |
Member |
|
|
Hi,
Here is the issue I am facing.
I have an Handled Tool Item on the main tool bar of the app and its canExecute method tests if a particular file list (WritableList bound to a TableViewer) shown on a particular part is empty or not.
Within the actual part that holds the list, I right click and launch the file add dialogue, add the files and eventually close the dialogue. However, the canExecute methods of handlers, including the others which I am not interested in this case, aren't called after this operation doesn't matter how long I wait and yes, I checked this with the debugger too.
If I click on the same part, it doesn't do anything either. However, clicking somewhere on a different tab does the magic, the method is executed and the button is enabled as expected.
The part that holds the file list also has a 'remove' item in the right click menu and when I use it, the canExecute is called straight away and the Handled Tool Item is greyed out as expected.
I remember reading that canExecute methods are executed periodically but this doesn't seem to be the case and they are triggered by events perhaps? If I speculate further and say that those events are fired when the framework thinks that the UI (even at least the focus) has changed but opening/closing the File Dialogue is overlooked in this context, would that be likely to be what's happening?
Does this sound like a known bug and is there anything you could suggest to work this around?
Regards,
Ozgur.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03654 seconds