如何在Eclipse E4中将菜单项添加到工具栏 [英] How to add menu Items to toolbar in Eclipse E4
问题描述
我有一个Eclipse RCP应用程序,并通过TrimBar-> Window Trim-> Toolbar-> Tool Control添加了一个收费栏。我试图使用SWT菜单添加菜单/菜单项,但是在工具栏中不可见。其他组件,如按钮,标签,组合框,都没有问题。
可以将菜单项添加到工具栏吗?
I have an Eclipse RCP application and have added a tollbar via TrimBar->Window Trim->Toolbar->Tool Control. I have tried to add menu/ menu items using SWT Menu but it is not visible in the toolbar. Other components like buttons,labels,combo boxes are added without any problem. Is it possible to add Menu Items to toolbar?
文件编辑视图工具窗口帮助这里-组合框要添加
File Edit View Tools Window Help Here-The-Combobox-To-Be-Added
文件/编辑/视图/工具/窗口/帮助是工具栏中的菜单项。然后添加一个组合框。
File/Edit/View/Tools/Window/Help are the menu items in the toolbar. And after that a combobox is to be added.
谢谢
推荐答案
一种解决方案可能是在装饰栏中添加一个组合框。
One solution might be to add a combo box to the trimbar.
我已经在装饰栏中试用了进度指示器:使用 ToolControl UI规范
元素。工具控件提供的类是POJO。这是我的进度绑定器的开始: WindowTrim-> Toolbar-> ToolControl
中的
I have tried out a progress indicator in the trim bar: Use a ToolControl
element in the UI specification WindowTrim->Toolbar->ToolControl
. The class given with the tool control is a POJO. Here is the beginning of my progress bindicator:
public class ProgressIndicator implements IProgressMonitor {
private ProgressBar progressBar;
@PostConstruct
public void createControls(final Composite parent) {
final Group g = new Group(parent, SWT.SHADOW_ETCHED_IN | SWT.FILL);
g.setLayout(new FillLayout());
g.setToolTipText(Nls.INSTANCE.getString("Progressbar.tooltip"));
this.progressBar = new ProgressBar(g, SWT.NONE );
this.progressBar.setVisible(false);
}
...
}
这篇关于如何在Eclipse E4中将菜单项添加到工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!