Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Toolbar Buttons Enablement problem
Toolbar Buttons Enablement problem [message #1772438] Sat, 09 September 2017 16:42 Go to next message
Eclipse UserFriend
Hello,

I have a bunch of actions inheriting from JFace Action class and implementing some listeners in order to define their enablements depending on the selection in a specific view. Then I define commands associated to each of these actions declaratively in plugin.xml : Action classes and commands in plugin.xml have same IDs . Then I create, still declaratively in plugin.xml, the main menu, the popup menu for this specific view and the main toolbar using command ids pointing to the previous ones.

My problem is that the main and popup menus items enablements reflect perfectly actions states but not the main toolbar buttons !
Why is it working properly for main and popup menus and not for toolbar ???!!!
It's like if the main toolbar buttons were always late. The toolbar buttons enablements reflects the state of the previous actions enablements !

I think my problem is very, very similar to this bug : https://bugs.eclipse.org/bugs/show_bug.cgi?id=180203
But I've not found any workaround. I know that it is better to use Handler instead of Action, but I would like to avoid any refactoring.

Is there any solution to this strange behaviour ?

Thanks,
Frank

[Updated on: Sat, 09 September 2017 16:45] by Moderator

Re: Toolbar Buttons Enablement problem [message #1772446 is a reply to message #1772438] Sun, 10 September 2017 03:19 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: Toolbar Buttons Enablement problem [message #1772447 is a reply to message #1772438] Sun, 10 September 2017 03:24 Go to previous messageGo to next message
Eclipse UserFriend
I've found a workaround by sending a second selection event from the widget contained in the specific view. But it's not a very nice solution...
Any other idea ?
Re: Toolbar Buttons Enablement problem [message #1772975 is a reply to message #1772447] Tue, 19 September 2017 11:39 Go to previous message
Eclipse UserFriend
What are you doing to update the toolbar actions?

The menu items likely work as the menu is being re-rendered everytime. The toolbar items not so much.
Previous Topic:Choosing plugins to update with P2 and eclipse 4 programmatically
Next Topic:Automatic Updates for a custom RCP product with Tycho build and own p2 repository
Goto Forum:
  


Current Time: Thu Jul 17 03:57:13 EDT 2025

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

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

Back to the top