Eclipse RCP:工具栏中的右对齐搜索字段 [英] Eclipse RCP: Right aligned search field in toolbar
问题描述
我想在Eclipse RCP应用程序的工具栏中有一个右对齐的搜索字段。我已经在ActionBarAdvisor类中创建了文本字段作为ControlContribution和相应的搜索操作:
I would like to have a right aligned search field in the toolbar of an Eclipse RCP application. I already created the text field as ControlContribution and the respective search action in the ActionBarAdvisor class:
protected void fillCoolBar(ICoolBarManager coolBar) {
IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
//...
toolbar.add(new ControlContribution("searchText") {
//...
此方法有效,并且工具栏上有搜索字段,但是如何在右侧对齐搜索文本(或带有搜索文本的工具栏)?
This works and I have the search field in the toolbar. But how can I align the search text (or the toolbar with the search text) on the right side?
谢谢,
Michael
Thanks, Michael
推荐答案
如果您的意思是定位搜索工具栏在主工具栏的右侧站点上,然后考虑改用这些区域(当使用 org.eclipse.ui.menus 扩展点):
If you mean positioning search toolbar on the right hand site of the main toolbar, then consider using these areas instead (when using org.eclipse.ui.menus extension point):
toolbar:org.eclipse.ui.main.toolbar - the top-level tool bar
toolbar:org.eclipse.ui.trim.command1 - the top left trim
toolbar:org.eclipse.ui.trim.command2 - the top right trim
toolbar:org.eclipse.ui.trim.vertical1 - the left vertical trim
toolbar:org.eclipse.ui.trim.vertical2 - the right vertical trim
toolbar:org.eclipse.ui.trim.status - the status line trim
这篇关于Eclipse RCP:工具栏中的右对齐搜索字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!