views:

57

answers:

2

Hey,

i am new to Eclipse RCP and have the following Scenario:

  • One plugin which is the Application
  • Another witch is a view and does show some Data
  • And a third which is the editor.

in the view I can right click on a record and choose edit what does open the Editor and lets me change the data.

No I'd like to refresh the View when I save the Editor. I think this is a classical scenario to implement a Whiteboard pattern. Unfortunately I am not really familiar with it, may be some one could show a simple example how to implement it in Eclipse RCP.

Thanks in Advance Johannes

+1  A: 

The view has to listen to the editor or - even better - to the edited model. If it listens to the editor, look for some "save" events. Personally I would make the model itself observable and notify listeners (like your view) of actual changes.

The view then needs some logic to extract its information from the model. So instead of a whitboard - the observer pattern should be the right choice for your design.


This is worth a try: add an IPropertyListener to the IEditorPart instance of your editor and wait for property changes. The IEditorPart.PROP_DIRTY property should change from "is dirty" to "is not dirty" after a save. Snippets/code example for eclipse rcp stuff are hard to develop and to communicate. Use the buzzwords from my answer for some searches on the eclipse help, API and on google. And: good luck ;) - btw, consider buying some good books on eclipse plugin/rcp development, they're worth every €/$ spent.

Andreas_D
Thanks for you respond, but du you have a simple source code example How I can tell the view, to listen to the editor?
john84
A: 

Try read this http://www.martinfowler.com/eaaDev/uiArchs.html

Stas