Skip to main content



      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 03:15 Go to next message
Eclipse UserFriend
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 05:46 Go to previous messageGo to next message
Eclipse UserFriend
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 07:10 Go to previous messageGo to next message
Eclipse UserFriend
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 09:30 Go to previous message
Eclipse UserFriend
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: Sun Jul 06 03:56:42 EDT 2025

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

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

Back to the top