How to communicate between views in Eclipse RCP?

后端 未结 3 978
星月不相逢
星月不相逢 2020-12-08 05:38

In Eclipse RCP, I am creating views for the Perspective using IPageLayout.addView(...)

But this way I don\'t have a reference to the view. Therefore I d

3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-08 06:06

    Besides what VonC has mentioned above, you can also use ISourceProviderListener if the changes you need are not triggered by selection.

    • Have ViewB implements ISourceProviderListener
    • Create an implementation of ISourceProvider and register it in the services
    • Have ViewA get the ISourceProvider and update it to trigger the changes in ViewB

    Read the documentation on those interfaces along with IServiceLocator and ISourceProviderService to get better idea how it all plays out.

    You can also see this Lars Vogel's tutorial which has some example how to use the ISourceProvider

提交回复
热议问题