[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: Reload editor contents when changed outside editor

Hi,

graphicalViewer.setContents(myModelRoot) is your friend.

Regards, Ingo




"Prashanto" <prashanto.chatterjee@xxxxxxxxxxxxxx> wrote in message
news:e97fbde3b94c3f8726dc59edd0060cb7$1@xxxxxxxxxxxxxxxxxx
> Hi,
>
> I am facing a problem with multipage editor.
> I have a multipage editor with a diagram-view of my application and a
> corresponding xml source view. I have a resource opened in my editor that
> can be changed by another plugin(assume changed by an entity other than
> the editor itself).
>
> Now I am faced with a problem of reloading the contents when such an
> external change occurs. I track such an event by registering a
> resourceChangeListener  and setting some flags in the editor. Now when the
> user switches back to the editor, in the setFocus method I check for the
> flag indicating external change and ask the user as to whether he wants to
> update the contents. Choosing no is easy and I save the existing state
> overwriting the previous change but when he chooses yes, I need to reload
> my editor contents (when in diagram-view; reload the diagram model and
> when in source-view; reload the xml source). I have tried setInput but it
> does not work.
>
> Can someone kindly shed some light on this.
>
> Regards,
> Prashanto
>