Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Reload editor contents when changed outside editor
Reload editor contents when changed outside editor [message #209925] Tue, 21 February 2006 11:22 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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
>
Re: Reload editor contents when changed outside editor [message #209968 is a reply to message #209935] Tue, 21 February 2006 14:23 Go to previous message
Eclipse UserFriend
Originally posted by: prashanto.chatterjee.softwareag.com

Hi Ingo,
That worked.

Thanks a lot for your prompt reply. I took your cue to implement somethig
similar in the source editor too.

Regards,
Prashanto
Previous Topic:how to Bridge GEF with EMF
Next Topic:Please add to FAQ instructions on importing example source!
Goto Forum:
  


Current Time: Thu Sep 26 04:04:12 GMT 2024

Powered by FUDForum. Page generated in 0.05468 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top