Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Register a ToolBar in an e4 view
Register a ToolBar in an e4 view [message #1755011] Sun, 26 February 2017 12:42
Vivien Jovet is currently offline Vivien JovetFriend
Messages: 9
Registered: February 2017
Junior Member
Hi,

I'm try to add a ToolBar inside a e4 view using a ToolBarManager and commands that look like this:
index.php/fa/28585/0/

I create the ToolBar like this:
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
// CommandFactory just create CommandContributionItem with the provided ID
toolBarManager.add(CommandFactory.makeCommandItem(IWorkbenchCommandConstants.EDIT_DELETE, CommandFactory.STYLE_PUSH));
toolBarManager.add(CommandFactory.makeCommandItem(FlowConstants.ID_COMMAND_ADD_PROPERTY, CommandFactory.STYLE_PUSH));
inputToolbar = toolBarManager.createControl(tab);


The ToolBar appears and the commands work but the problem is that the buttons of the ToolBar are not updated with the selection (enabled/disabled state). They are only updated when the popup context menu of the table appears (which is using the same commands).

To register the popup context menu of the table I use the injected EMenuService:
menuService.registerContextMenu(viewer.getControl(), menuId);


It works great for popup context menu, is there a similar service for populating and registering ToolBars?
Previous Topic:JDT bootclasspath problem
Next Topic:Mark eclipse editor as not dirty if there aren't any changes
Goto Forum:
  


Current Time: Wed Nov 14 22:17:10 GMT 2018

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

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

Back to the top