views:

841

answers:

2

Hi, what's the best way to make communications between page widgets residing on differents ViewPart?

via listener or via shared object instances like "getViewSite().getPart()/getPage()" ? what pro/contra and what's the best strategy for You?

Thanks, regards

+1  A: 

The answer depends on the nature of the changes. Why is one ViewPart causing changes in another ViewPart?

For example, if the change is because one ViewPart is changing the model data and the other ViewPart is displaying the same data then you should be going through the model. One ViewPart updates the model and the other is listening to the model for changes. This is basic MVC.

If, on the other hand, the change is caused because of a selection (for example, a change in the selection in the navigation view causes another view to display the contents of that selection) then you should be using the global selection handler.

The question needs to be updated to be more specific to get the correct answer.

+1  A: 

I would suggest looking at the Eclipse Modeling Framework

PSU_Kardi