Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » canExecute of contributed HandledToolItem isn't always called(Upon firing a file dialogue and closing it, canExecute methods of handlers aren't called until another part is clicked)
canExecute of contributed HandledToolItem isn't always called [message #1385257] Thu, 05 June 2014 08:45 Go to next message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
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.
Re: canExecute of contributed HandledToolItem isn't always called [message #1388983 is a reply to message #1385257] Fri, 27 June 2014 07:06 Go to previous messageGo to next message
Luca Moretto is currently offline Luca MorettoFriend
Messages: 4
Registered: June 2014
Junior Member
Hi,
you may try the solution proposed in this thread: https://www.eclipse.org/forums/index.php/t/782615/

I had the same problem for toolitems in Luna, and the above solution fixed it.

Luca
Re: canExecute of contributed HandledToolItem isn't always called [message #1697019 is a reply to message #1388983] Sun, 31 May 2015 13:37 Go to previous message
Ozgur Cagdas is currently offline Ozgur CagdasFriend
Messages: 32
Registered: May 2013
Member
Luca,

Thanks. The thread you pointed out does solve my problem it. Specifically, this post https://www.eclipse.org/forums/index.php?t=msg&th=782615&goto=1387903&#msg_1387903 .
Previous Topic:E4 Tools update site for Mars
Next Topic:org.eclipse.e4.core.di.annotations in v. 1.5.0
Goto Forum:
  


Current Time: Tue Mar 19 05:41:32 GMT 2024

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

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

Back to the top