Gap between search menu and its previous menu on addition of search plugin

会有一股神秘感。 提交于 2019-12-11 03:06:27

问题


I added the Search Plugin to my RCP application. On addition of this plugin it adds the search menu in main menu bar.

I observed that there is some pixels gap between search menu and its previous menu. Please see the image.

Does anyone know how this is coming and how I can remove it?


回答1:


I fixed this issue by modifying postWindowCreate method of ApplicationWorkbenchWindowAdvisor class of RCP application.

IWorkbenchPage page = this.getWindowConfigurer().getWindow().getActivePage();
MenuManager menuBarManager = ((ApplicationWindow)page.getWorkbenchWindow()).getMenuBarManager();
menuBarManager.remove("navigate");



回答2:


Insert a "navigate" path in your ActionBarAdvisor implementation:

protected void fillMenuBar(IMenuManager menuBar) {

menuBar.add(createFileMenu());
menuBar.add(createEditMenu());
menuBar.add(new GroupMarker(IWorkbenchActionConstants.M_NAVIGATE));
menuBar.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
menuBar.add(createHelpMenu());

}



来源:https://stackoverflow.com/questions/14396517/gap-between-search-menu-and-its-previous-menu-on-addition-of-search-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!