Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » AbstractHandler.setBaseEnabled method does not work for toolbar item
AbstractHandler.setBaseEnabled method does not work for toolbar item [message #1415140] Tue, 02 September 2014 07:15 Go to next message
Ugur Ozdemir is currently offline Ugur OzdemirFriend
Messages: 7
Registered: September 2014
Junior Member
Hi,

I try to disable a toolbar item with AbstractHandler.setBaseEnabled method but it does not work. To reproduce the problem please follow below instructions,

1- Create 3.x rich client application with "RCP application with a view" template.
2- Create a command and default handler (with extending AbstractHandler).
3- Call setBaseEnabled(false) method in execute method.
4- Add toolbar menucontribution to plugin.xml.
5- Add created command to toolbar menucontribution.
6- Run the application.

It works with kepler (4.3.2) but it does not work with luna (4.4.0).

Thanks.
Re: AbstractHandler.setBaseEnabled method does not work for toolbar item [message #1576496 is a reply to message #1415140] Wed, 21 January 2015 10:46 Go to previous messageGo to next message
Darren Hurt is currently offline Darren HurtFriend
Messages: 32
Registered: July 2009
Member
I get the same problem.
Did you manage to resolve this or find a workaround?


Re: AbstractHandler.setBaseEnabled method does not work for toolbar item [message #1576610 is a reply to message #1576496] Wed, 21 January 2015 12:10 Go to previous messageGo to next message
Ugur Ozdemir is currently offline Ugur OzdemirFriend
Messages: 7
Registered: September 2014
Junior Member
When you select an item from the list, toolbar item is updated. As a workaround I just get the selected item from the viewer (which is treeviewer for me) and reselect the same item. This way toolbar item(s) are updated. Reselection of the item is below;
ISelection selection = viewer.getSelection();
if(selection != null)
{
    viewer.setSelection(selection)
}
Re: AbstractHandler.setBaseEnabled method does not work for toolbar item [message #1576801 is a reply to message #1415140] Wed, 21 January 2015 14:30 Go to previous message
Thibault Le Ouay is currently offline Thibault Le OuayFriend
Messages: 23
Registered: October 2014
Junior Member
Does your Handler implements IElementUpdater ?

then you should try with that and all call the right ICommandService in your Execute Method of your handler
Previous Topic:Contributing to a view toolbar withSourceProvider result = blury icons but not with PropertyTester
Next Topic:Adding custom perspective in perspective switcher eclipse e4
Goto Forum:
  


Current Time: Fri Apr 19 21:17:37 GMT 2024

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

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

Back to the top