Reload editor contents when changed outside editor [message #209925] |
Tue, 21 February 2006 11:22 |
Eclipse User |
|
|
|
Originally posted by: prashanto.chatterjee.softwareag.com
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
|
|
|
Re: Reload editor contents when changed outside editor [message #209935 is a reply to message #209925] |
Tue, 21 February 2006 11:56 |
Eclipse User |
|
|
|
Originally posted by: ingo.koch[nospam].sap.com
Hi,
graphicalViewer.setContents(myModelRoot) is your friend.
Regards, Ingo
"Prashanto" <prashanto.chatterjee@softwareag.com> wrote in message
news:e97fbde3b94c3f8726dc59edd0060cb7$1@www.eclipse.org...
> 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
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.02784 seconds