我可以以CommandContributionItem编程方式创建如下:
CommandContributionItemParameter param = new CommandContributionItemParameter(serviceLocator, id, commandId, CommandContributionItem.STYLE_PUSH);
CommandContributionItem item = new CommandContributionItem(this);
如果我将样式更改CommandContributionItem.STYLE_PUSH为CommandContributionItem.STYLE_PULLDOWN然后我可以在工具栏中创建下拉菜单而不是按钮。
现在我的问题是我将如何填写items这个ContributionItem。对象上已经存在填充方法,CommandContributionItem但我想将其他CommandContributionItem对象输入为menu items. 我将如何做到这一点?