ToolBarManager的问题
来源:互联网 发布:php网页游戏源代码 编辑:程序博客网 时间:2024/06/05 05:05
It's difficult to tell from your question, but it sounds like you may be attempting to add a ControlContribution to the toolbar and returning a Button. This would make the button on the toolbar appear like a native button like you seem to be describing. This would look something like this:
IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.add(new ControlContribution("Toggle Chart") { @Override protected Control createControl(Composite parent) { Button button = new Button(parent, SWT.PUSH); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { // Perform action } }); } });
Instead you should add an Action to the toolbar. This will create a button on the toolbar that matches the standard eclipse toolbar buttons. This would look something like this:
Action myAction = new Action("", imageDesc) { @Override public void run() { // Perform action } }; IToolBarManager toolBarManager = actionBars.getToolBarManager(); toolBarManager.add(myAction);
- ToolBarManager的问题
- 扩展ToolBarManager、ListView和Grid控件以实现气球式的ToolTip
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 为ToolBarManager添加自定义控件
- 问题背后的问题
- 关于问题的问题
- 问题背后的问题
- 有问题的问题?.?
- 的问题
- 问题++: firefox的关闭问题
- 问题:input类型的问题
- 百鸡问题的问题
- Qt creater系列教程学习笔记——3
- C#语言 第三部分 集合框架 IList,IList——向量(1)
- 基本控件的概念和使用
- SWT.IMAGE
- 最大化窗口
- ToolBarManager的问题
- div+css 画圆角矩形
- RCP实用技巧
- 分页保存图片
- Object类
- RCP中权限与菜单的操作例子关键字: rcp中权限与菜单的操作例子 from
- Ferrari [Single
- Christian Louboutin Red-headed sheepskin journals
- Dolce & Gabbana up