When does the diagram editor start listening for graphical changes ? [message #69596] |
Wed, 25 October 2006 18:40  |
Eclipse User |
|
|
|
Originally posted by: atoulme.intalio.com
Hi,
I am trying to figure out where the diagram editor starts listening for
graphical changes.
I have noticed that a CustomModificationListener was generated, and
listened to the SET changes.
I cannot find where a listener is added to the Diagram object so that
changes are reported, and the diagram editor is set to dirty. Is it
somewhere in the DocumentProvider ?
Any help appreciated !
Antoine Toulme
|
|
|
|
|
|
|
Re: When does the diagram editor start listening for graphical changes ? [message #72196 is a reply to message #71163] |
Tue, 31 October 2006 10:22   |
Eclipse User |
|
|
|
Antoine,
Could you clarify your question please? Unfortunately, I don't quite
understand what the issue is.
Thanks,
Cherie
Antoine Toulmé wrote:
> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
|
|
|
Re: When does the diagram editor start listening for graphical changes ? [message #72233 is a reply to message #71163] |
Tue, 31 October 2006 10:53   |
Eclipse User |
|
|
|
Hi Antonie ;
I'm not sure what do you mean by Graphical changes; since you are
talking about resources; I'll assume you are talking about EMF changes
to your semantic model or notation model
By default every GraphicalEditPart will add a listener to its semantic
element and notation view in the methods :
addNotationalListeners and addSemanticListeners
These methods will be called on the edit part activation, if you like
to listen to extra elements you can override these methods in your edit
part add the extra listener
Edit part handle the events in the handleNotificationEvent method, this
is where you will need to add the extra event handling code
One, thing to keep in mind though, these listeners are EObject
Listeners and not Resource level event listeners, if you like to listen
to change on the resource level not on the EObject level you can check
NoteEditPart, in this edit part i needed to listen to resource level
changes (like load and unload ), check the ResourceListener member in
this class and it should give you an idea on how to do that.
I hope this helps. If my answer is not really what you are asking about
then you can give us more details on what you are trying to archive, we
might be able to help
Thanks
Antoine Toulmé wrote:
> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
|
|
|
Re: When does the diagram editor start listening for graphical changes ? [message #72248 is a reply to message #71163] |
Tue, 31 October 2006 11:21  |
Eclipse User |
|
|
|
Antoine Toulmé wrote:
One more place that might be of interest to you; is the place where the
editor make triggers the DigramEventBroker to start listening which will
be in the DiagramEditor#startListening method
> Alex,
> I found out that a GMF Resource was used and listened to after taking
> some time on the debugger. I think the ResourceSet is being listened to
> through the domain. I'd be very pleased to have the guys from the
> runtime team tell us about that !
>
> Alex Shatalin wrote:
>> Hello Antoine,
>>
>>> actually I found out that graphical changes are handled by listening
>>> to the ResourceSet, using a GMFResource object, for which tracking
>> Can you please point me to the place where GMF is listening for
>> corresponding notifications from the ResourceSet?
>> AFAIK, GMF will not works well if you use custom ResourceFactory for
>> diagram resources. Looks like diagrams should be loaded by appropriate
>> ResourceFactory registered in the geenrated plugin.xml. In any case,
>> this is mostly a question to the runtime team.
>>
>> -----------------
>> Alex Shatalin
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04587 seconds