[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Newsgroup Home]
|
[news.eclipse.platform] Adding command to a toolbar
|
I want to add programatically an command to a toolbar of a site of a
PageBookView. At moment I create a CommandContributionItem:
toolBar.appendToGroup("groupID", new CommandContributionItem(
new CommandContributionItemParameter(site, "menuID",
"commandID", null,
MyUI.getImageDescriptor("imageID"), null, null,
"Test", null, "Pulldown Test Item",
CommandContributionItem.STYLE_PULLDOWN, null)));
The command and its pulldown items appears, but the enablement works not
correct:
1) If the view loose the focus, the button in the toolbar is disabled.
For keybindings, this is what I expect (command is no longer available), but
toolbar buttons in the view should stay enabled.
2) If the command is disabled, the button is not updated. The command
throws an event (new HandlerEvent(this, true, false), but the toolbar button
is not
disabled.
Any ideas? Should I go back to the old Actions?
Thanks,
Teddy