how to listen to the change when I add a connection in editor? [message #21770] |
Wed, 16 August 2006 22:41  |
Eclipse User |
|
|
|
Originally posted by: dzhpingbo.sohu.com
I use AdapterFactoryContentProvider and overwrite its
notifyChanged(Notification notification) method, it can listen most of the
changes in the Editor,such as add,delete nodes and so on,but can not listen
to the change when I add a connection between nodes.
It looks strange, I think it should do the listening of connections, but it
didn't in my case, I want to know if there is any other way to listen for
the change when I add a connection between nodes?
|
|
|
Re: how to listen to the change when I add a connection in editor? [message #22463 is a reply to message #21770] |
Thu, 17 August 2006 10:25   |
Eclipse User |
|
|
|
dzh wrote:
> I use AdapterFactoryContentProvider and overwrite its
> notifyChanged(Notification notification) method, it can listen most of the
> changes in the Editor,such as add,delete nodes and so on,but can not listen
> to the change when I add a connection between nodes.
>
> It looks strange, I think it should do the listening of connections, but it
> didn't in my case, I want to know if there is any other way to listen for
> the change when I add a connection between nodes?
>
>
Connecting 2 nodes will result in changing at least three EObjects :
1 - The Source View, this will result in firing an add event on the
SourceEdges EStructual feature of this view
2- The target View, this will result in firing an add event on the
TargetEdges EStructual feature of this view
3- The diagram that contain this edge, this will fire an add event on
the persistedChildren or the transientChildren EStructual feature of
this Diagram
so, you can catch the event you like in the appropriate edit part.
|
|
|
Re: how to listen to the change when I add a connection in editor? [message #22550 is a reply to message #22463] |
Thu, 17 August 2006 11:46  |
Eclipse User |
|
|
|
Originally posted by: dzhpingbo.sohu.com
> Connecting 2 nodes will result in changing at least three EObjects :
> 1 - The Source View, this will result in firing an add event on the
> SourceEdges EStructual feature of this view
> 2- The target View, this will result in firing an add event on the
> TargetEdges EStructual feature of this view
> 3- The diagram that contain this edge, this will fire an add event on the
> persistedChildren or the transientChildren EStructual feature of this
> Diagram
>
> so, you can catch the event you like in the appropriate edit part.
yes, I agree with you. But I don't want to change the code which is
generated by gmf, regarding that gmf will be updated in future.
First try, I new AdapterFactoryContentProvider() and overwrite its
notifyChanged(Notification notification) method and listen to the changes,
unfortunately, it doesn't work in my case.
How can I listen to this change without change the code generated by gmf?
thank you.
|
|
|
Powered by
FUDForum. Page generated in 0.03746 seconds