Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Reloading/Refreshing GMF editor without reopening the editor
Reloading/Refreshing GMF editor without reopening the editor [message #174083] Mon, 25 February 2008 00:13 Go to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi,

My requirement is to reload the GMF Editor whenever there is a change in
the tree.For example:

If I add a element in the tree then I have to refresh the editor with the
new object.

I tried to reopen the editor by calling the EditorUtil's openDiagram() but
it will create another diagram file.I want to use the same diagram file
and then update the values.

Note : The tree uses different model and GMF editor uses different model.
I have a mapper to load data from tree to GMF editor.

Any help would be appreciated.

Thanks in advance.

Regards,
Shwetha
Re: Reloading/Refreshing GMF editor without reopening the editor [message #174118 is a reply to message #174083] Mon, 25 February 2008 07:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Shwetha,

The generated EMF editor listens to workspace deltas and refreshes the
contents of any resource that's changed. I though the GMF editor did
the same thing. What is the nature of these changes you describe? Are
they done by updating the workspace? Or using a command? I would
expect either of those to work properly...


Shwetha wrote:
> Hi,
>
> My requirement is to reload the GMF Editor whenever there is a change
> in the tree.For example:
>
> If I add a element in the tree then I have to refresh the editor with
> the new object.
>
> I tried to reopen the editor by calling the EditorUtil's openDiagram()
> but it will create another diagram file.I want to use the same diagram
> file and then update the values.
>
> Note : The tree uses different model and GMF editor uses different model.
> I have a mapper to load data from tree to GMF editor.
>
> Any help would be appreciated.
>
> Thanks in advance.
>
> Regards,
> Shwetha
>
>
>
>
Re: Reloading/Refreshing GMF editor without reopening the editor [message #174280 is a reply to message #174118] Mon, 25 February 2008 23:42 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Ed,

I have a Tree model for TreeView and GMF model for GMF editor and a
mapper(pojo) that maps between the 2 model as I explained before.

I'm not using workspace concept or commands to do any modification.

If I have to update the TreeView with any values changed in the GMF editor
I use resourceChanged() in XXXDiagramEditor and it works fine.(as you said
about the default editor feature).

My doubt is how to notify/reload the GMF editor when there is a change in
the TreeView without reopening the editor.

Hope my requirement is clear.Any help is appreciated.

Thanks in advance.

Regards,
Shwetha
Re: Reloading/Refreshing GMF editor without reopening the editor [message #174323 is a reply to message #174280] Tue, 26 February 2008 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Shwetha,

I'm still kind of confused. The editor will be showing the contents of
the resources in the workspace, right? So how does a change to the
TreeView affect what's in the workspace? If it doesn't, then how is the
GMF editor to even know about the TreeView's contents? There's just a
puzzle piece missing for me to understand this...


Shwetha wrote:
> Hi Ed,
>
> I have a Tree model for TreeView and GMF model for GMF editor and a
> mapper(pojo) that maps between the 2 model as I explained before.
>
> I'm not using workspace concept or commands to do any modification.
>
> If I have to update the TreeView with any values changed in the GMF
> editor I use resourceChanged() in XXXDiagramEditor and it works
> fine.(as you said about the default editor feature).
>
> My doubt is how to notify/reload the GMF editor when there is a change
> in the TreeView without reopening the editor.
>
> Hope my requirement is clear.Any help is appreciated.
>
> Thanks in advance.
>
> Regards,
> Shwetha
>
>
Re: Reloading/Refreshing GMF editor without reopening the editor [message #174442 is a reply to message #174323] Tue, 26 February 2008 23:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Ed,

I have used a interface LoadNotifier to update all the views.
In the xxxDiagarmEditor I implement interface LoadNotifier with a method
notifyRefresh(I have to inlcude snippet here to refresh/reload the GMF
editor on any change in the TreeView).

The workspace resource you mean is the semantic gmf model is it???
Since i'm using 2 different model i cant directly update the gmf
model.Hence I'm using Mapper to map from Tree Model to GMF model and
Notify mechanism to refresh both.

Hope this is clear.

Thanks in advance.

Regards,
Shwetha
Re: Reloading/Refreshing GMF editor without reopening the editor [message #174520 is a reply to message #174442] Wed, 27 February 2008 08:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Shwetha,

Hopefully the GMF folks understand it because I don't know about these
mechanisms...


Shwetha wrote:
> Hi Ed,
>
> I have used a interface LoadNotifier to update all the views.
> In the xxxDiagarmEditor I implement interface LoadNotifier with a
> method notifyRefresh(I have to inlcude snippet here to refresh/reload
> the GMF editor on any change in the TreeView).
>
> The workspace resource you mean is the semantic gmf model is it???
> Since i'm using 2 different model i cant directly update the gmf
> model.Hence I'm using Mapper to map from Tree Model to GMF model and
> Notify mechanism to refresh both.
>
> Hope this is clear.
>
> Thanks in advance.
>
> Regards,
> Shwetha
>
Re: Reloading/Refreshing GMF editor without reopening the editor [message #175200 is a reply to message #174083] Mon, 03 March 2008 12:42 Go to previous messageGo to next message
Eclipse UserFriend
Hello Shwetha,

> I tried to reopen the editor by calling the EditorUtil's openDiagram()
Try using IWorkbenchPage.openEditor(editorInput, xxxDiagramEditor.ID);

> Note : The tree uses different model and GMF editor uses different
> model. I have a mapper to load data from tree to GMF editor.
To my understansing in this point GMF editor should recognize that new elements
were created and perform update automatically.
If you are just updating model file content and saving it to the eclipse
workspace then GMF editor should note corresponding changed resource and
perform update automatically..

-----------------
Alex Shatalin
Re: Reloading/Refreshing GMF editor without reopening the editor [message #175606 is a reply to message #175200] Tue, 04 March 2008 10:34 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Hi Alex,

Thanks alot for your reply.

But how do I intialise the editorInput with my gmfModel object.
It throws ClassCast Exception.

In this case wont it create another diagram file and semantic file???

Awaiting for your reply.

Thanks and Regards,
Shwetha
Re: Reloading/Refreshing GMF editor without reopening the editor [message #175630 is a reply to message #174520] Tue, 04 March 2008 10:48 Go to previous messageGo to next message
Eclipse UserFriend
Question.
Would it be correct to say that you have 2 mutually exclusive semantic
models? one that you using for the tree and one that you are using in the
gmf editor?


"Ed Merks" <merks@ca.ibm.com> wrote in message
news:fq3p2b$esm$2@build.eclipse.org...
> Shwetha,
>
> Hopefully the GMF folks understand it because I don't know about these
> mechanisms...
>
>
> Shwetha wrote:
>> Hi Ed,
>>
>> I have used a interface LoadNotifier to update all the views.
>> In the xxxDiagarmEditor I implement interface LoadNotifier with a method
>> notifyRefresh(I have to inlcude snippet here to refresh/reload the GMF
>> editor on any change in the TreeView).
>>
>> The workspace resource you mean is the semantic gmf model is it???
>> Since i'm using 2 different model i cant directly update the gmf
>> model.Hence I'm using Mapper to map from Tree Model to GMF model and
>> Notify mechanism to refresh both.
>>
>> Hope this is clear.
>>
>> Thanks in advance.
>>
>> Regards,
>> Shwetha
>>
Re: Reloading/Refreshing GMF editor without reopening the editor [message #175666 is a reply to message #175606] Tue, 04 March 2008 11:40 Go to previous messageGo to next message
Eclipse UserFriend
Hello Shwetha,

It should not. You can use FileEditorInput or URIEditorInput instance. Just
create corresponding instances and use it.

-----------------
Alex Shatalin
Re: Reloading/Refreshing GMF editor without reopening the editor [message #175721 is a reply to message #175630] Wed, 05 March 2008 03:49 Go to previous message
Eclipse UserFriend
Originally posted by: Shwetha.V.in.bosch.com

Its not mutually exclusive.I just fill the TreeModel data in GMF Model.

Hope this will make the requirement clear.

Regards,
Shwetha
Previous Topic:create file
Next Topic:How to make diagram elements un-movable
Goto Forum:
  


Current Time: Thu Jul 24 18:38:39 EDT 2025

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

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

Back to the top