由于发布的解决方案没有生成透明背景图标,因此我对如何获得与Plug-In Manifest Editor的Extension Page相同的结果进行了一些研究.

以下是他们创建工具栏的方式:
ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
ToolBar toolbar = toolBarManager.createControl(section);
toolbar.setCursor(Display.getDefault().getSystemCursor(SWT.CURSOR_HAND));
// Add sort action to the tool bar
fSortAction = new SortAction(fExtensionTree, PDEUIMessages.ExtensionsPage_sortAlpha, null, null, this);
toolBarManager.add(fSortAction);
// Add collapse action to the tool bar
fCollapseAction = new CollapseAction(fExtensionTree, PDEUIMessages.ExtensionsPage_collapseAll);
toolBarManager.add(fCollapseAction);
toolBarManager.update(true);
section.setTextClient(toolbar);
Run Code Online (Sandbox Code Playgroud)
编辑:
这似乎也很有效:
ToolBar toolbar = new ToolBar(section, SWT.NONE);
//add the toolitems here
//...
section.setTextClient(toolbar);
Run Code Online (Sandbox Code Playgroud)
不要让Window Builder Tool适应工具栏FormToolkit,否则您将获得绘制的白色背景.
| 归档时间: |
|
| 查看次数: |
3250 次 |
| 最近记录: |