Passing parameters to the view

陌路散爱 提交于 2019-12-01 18:47:52

Create a new interface, giving it a method like accept( Object parameter ) and make your views implement it.

Then, when you do PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(viewId, String.valueOf(++viewCounter), IWorkbenchPage.VIEW_ACTIVATE) the method showView returns an IViewPart. Cast this return to your interface and call the accept method.

Tom Seidel

Use the SelectionService for that, please refer to Eclipse RCP let two views communicate

Implement the SelectionProvider in your "Navigation" and in the opened view you can ask for the selected object from the selection-service (see article)

HTH Tom

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