2010-10-19 71 views
4

我想在Eclipse RCP應用程序的工具欄中有一個右對齊的搜索字段。我已經創建的文本字段ControlContribution並在ActionBarAdvisor類各自的搜索行動:Eclipse RCP:工具欄中的右對齊搜索字段

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

這工作,我有工具欄的搜索字段。但是,如何將右側的搜索文本(或搜索文本與工具欄)對齊?

感謝, 邁克爾

回答

8

如果你的意思是在主工具欄的右手網站定位的搜索工具欄,然後再考慮用這些區域,而不是(使用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 
+1

我有重置視角/刪除工作區以查看結果... – wuppi 2012-04-12 12:22:15