Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Toolbar Buttons Enablement problem
Toolbar Buttons Enablement problem [message #1772438] Sat, 09 September 2017 20:42 Go to next message
Frank Buloup is currently offline Frank BuloupFriend
Messages: 5
Registered: August 2017
Junior Member
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 20:45]

Report message to a moderator

Re: Toolbar Buttons Enablement problem [message #1772446 is a reply to message #1772438] Sun, 10 September 2017 07:19 Go to previous messageGo to next message
Frank Buloup is currently offline Frank BuloupFriend
Messages: 5
Registered: August 2017
Junior Member
No Message Body
Re: Toolbar Buttons Enablement problem [message #1772447 is a reply to message #1772438] Sun, 10 September 2017 07:24 Go to previous messageGo to next message
Frank Buloup is currently offline Frank BuloupFriend
Messages: 5
Registered: August 2017
Junior Member
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 15: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 Apr 25 07:37:50 GMT 2024

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

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

Back to the top