Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » listening for UML2 creation/deletion events
listening for UML2 creation/deletion events [message #473378] Thu, 13 March 2008 02:36 Go to next message
Eclipse User
Originally posted by: ogechi.nnadi.gatech.edu

Hi all,

My application needs to know when the UML model underlying a diagram
that is being edited with UML2tools has changed. I know I have to
register a listener for model change events but I don't know what the
model class is for UML diagrams, or where I can access it from.

Has anyone tried to do something similar before?

Thanks,

Oge.
Re: listening for UML2 creation/deletion events [message #473379 is a reply to message #473378] Thu, 13 March 2008 04:52 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Oge,

org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker is 'a model
server listener that broadcast EObject events to all registered listeners.'
Our GraphicalEditParts register their model-listeners by using DiagramEventBroker#addNotificationListener()
methods. DiagramEventBroker is accessible by DiagramEventBroker.getInstance(TransactionalEditingDomain).
I thing, taking a look into GraphicalEditParts#addListenerFilter(..) methods
and their usages will make things clear,

Good luck,
Tatiana.

> Hi all,
>
> My application needs to know when the UML model underlying a diagram
> that is being edited with UML2tools has changed. I know I have to
> register a listener for model change events but I don't know what the
> model class is for UML diagrams, or where I can access it from.
>
> Has anyone tried to do something similar before?
>
> Thanks,
>
> Oge.
>
Re: listening for UML2 creation/deletion events [message #618497 is a reply to message #473378] Thu, 13 March 2008 04:52 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Oge,

org.eclipse.gmf.runtime.diagram.core.listener.DiagramEventBr oker is 'a model
server listener that broadcast EObject events to all registered listeners.'
Our GraphicalEditParts register their model-listeners by using DiagramEventBroker#addNotificationListener()
methods. DiagramEventBroker is accessible by DiagramEventBroker.getInstance(TransactionalEditingDomain).
I thing, taking a look into GraphicalEditParts#addListenerFilter(..) methods
and their usages will make things clear,

Good luck,
Tatiana.

> Hi all,
>
> My application needs to know when the UML model underlying a diagram
> that is being edited with UML2tools has changed. I know I have to
> register a listener for model change events but I don't know what the
> model class is for UML diagrams, or where I can access it from.
>
> Has anyone tried to do something similar before?
>
> Thanks,
>
> Oge.
>
Previous Topic:listening for UML2 creation/deletion events
Next Topic:gmfgen problem
Goto Forum:
  


Current Time: Fri Apr 18 01:33:54 EDT 2014

Powered by FUDForum. Page generated in 0.21635 seconds