Eclipse RCP: how to register ISourceProviderListener

I tried the following today:

I have:

  • a view form ( FormView )
  • a AbstractSourceProvider

    ( Provider ) to provide changes to the FormView in the world
  • a View ( ConsumerView ), which should consume information from the Provider , it implementsISourceProviderListener

The FormView updates the Provider that is launching fireSourceChanged

. But how can I register the ConsumerView so that it listens for changes in the Provider ?

This answer here on stackoverflow didn't really explain how to do this: How to communicate between views in Eclipse RCP?

Lars Vogels manuals on RCP commands are also mentioned a lot, but I don't get them from there.

Thanks for your help in advance!

0


source to share


1 answer


From your ConsumerView method createPartControl(..)

:



ISourceProviderService service = (ISourceProviderService)getSite().getService(ISourceProviderService.class);

ISourceProvider yourProvider = service.getSourceProvider("yourSourceProviderName");

yourProvider.addSourceProviderListener(this);

      

0


source







All Articles