开发者

Display a pulldown item in Eclipse programatically

开发者 https://www.devze.com 2023-02-18 12:58 出处:网络
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 IToolBarMana

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

精彩评论

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