0
我使用ActionBarAdvisor的子類向RCP應用程序的工作臺coolbar添加了JFace操作。出於某種原因,相應的菜單是用我認爲是多餘的線條繪製的。這是導致整個酷工具欄包括打開透視圖列表是方式太高:Eclipse RCP Workbench中的單行菜單操作Coolbar
任何人都知道如何讓它單成蔭?我嘗試將SWT.SINGLE樣式添加到Action構造函數中,但這沒有幫助。任何幫助,將不勝感激。謝謝。
ActionBarAdvisor.fillCoolBar()實現:
protected void fillCoolBar(final ICoolBarManager coolBar) {
final IToolBarManager toolbar = new ToolBarManager(coolBar.getStyle());
coolBar.add(new ToolBarContributionItem(toolbar, "main"));
toolbar.add(new Pulldown());
}
行動實施:
public class Pulldown extends Action {
public Pulldown() {
super("Saved Layouts");
setMenuCreator(menuCreator);
}
...
}
使用擴展點確實奏效,謝謝。對於任何有此相同問題的人,請注意,您必須使用可限制功能的代理(IWorkbenchWindowActionDelegate)(例如我的案例中的細粒度啓用控制)。 – 2012-07-27 08:45:40