eclipse-rcp - eclipse RCP : Right aligned search field in toolbar

标签 eclipse-rcp toolbar

我想在 Eclipse RCP 应用程序的工具栏中有一个右对齐的搜索字段。我已经在 ActionBarAdvisor 类中创建了文本字段作为 ControlContribution 和相应的搜索操作:

protected void fillCoolBar(ICoolBarManager coolBar) {
  IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
  //...
  toolbar.add(new ControlContribution("searchText") {
  //...

这有效,我在工具栏中有搜索字段。但是如何在右侧对齐搜索文本(或工具栏与搜索文本)?

谢谢,
迈克尔

最佳答案

如果您的意思是将搜索工具栏定位在主工具栏的右侧站点,那么请考虑使用这些区域(当使用 org.eclipse.ui.menus 扩展点时):

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 - eclipse RCP : Right aligned search field in toolbar,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3969715/

相关文章:

java - 从片段访问插件,反之亦然

maven - 使用 Maven 构建 Eclipse 插件

Eclipse 编辑器 : show markers on custom column of vertical ruler

android - AppCompat 工具栏不显示菜单 XML 中的图标集

android - 使用 v7 库时更改 ActionBarDrawer 切换图标

ckeditor - 如何禁用 ckeditor 4 中的源按钮

tdd - 如何使用 Equinox/OSGi - Tycho - Eclipse RCP 环境遵循测试优先方法

java - 可作为具有参数交换的 OSGi 包执行

java - 如何实现WebView滚动时隐藏工具栏?

android - 是否可以制作 Google Photos 风格的搜索栏?