切换到Windows经典主题组合贡献项目缩小

时间:2009-06-11 06:04:48

标签: eclipse eclipse-rcp

我确实遇到了IToolbarManager的问题。我添加了一个组合&像这样的视图的微调器工具栏

IToolbarManager mgr = getViewSite().getActionBars().getToolBarManager();
mgr.add(spinnerCntrAction);

spinnerCntrAction = new ControContribution(){

 public Control createControl(){
        //Creates composite
        //Create a spinner and add that to composite
        //return composite
 }


};

在Windows XP / Vista主题中,此微调器正确显示。但是当程序在windows经典主题下运行时,微调器会缩小并且无法正确显示。

这是一个已知问题吗?你知道任何解决方法/补丁吗?

由于 Jijoy

1 个答案:

答案 0 :(得分:0)

这是SWT中的错误。见http://dev.eclipse.org/newslists/news.eclipse.platform.swt/msg44671.html

这是一种解决方法:

mgr.add(new DummyAction());

private static class DummyAction extends Action {
   DummyAction() {
      setEnabled(false);
      setText("     ");
   }
}
...
mgr.add(spinnerCntrAction);

这将使工具栏管理器使所有控件贡献与Action的大小相同,因此调整Action文本中的空格数以获得所需的结果。