开发者

Display a pulldown item in Eclipse programatically

I know that I can declare actions in plugin.xml that specify style="pulldown" in order to make a pulldown style toolbar button, but I want to be able to do it programatically, using the IToolBarManager and IContributionItem interfaces.

I've looked through the interfaces, and the implementations of various things in eclipse, but I can't see how I'd do it. Ideally I want to 开发者_JS百科add such a toolbar item from an IEditorActionBarContributor implementation.

Anyone got any ideas?


In answer to my own question, you need to create an Action object, and then call setMenuCreator on the action. Then when you add the action to the toolbar you'll get a drop down menu.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜