regarding ResourceSetModificationListener [message #224176] |
Thu, 02 April 2009 18:18 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hi all,
Apart from knowing the resource which has changed when the notification
arrived to XXXDocumentProvider, and the event type, is it possible to know
the element in that resource which has changed? The object returned by the
call notification.getNewValue() does not properly shown the value that I
need.
For example, my DSL diagram editor is opened in a resource (R1) and some
elements are linked to some elements in a UML class diagram opened in
another resource (R2). If the name of a linked class is changed in R2, R1 is
properly updated but I do not know which element in R2 caused the
ResourceSetModification notification. Could I get it some how?
Thanks in advance for your time,
Bego
|
|
|
|
Re: regarding ResourceSetModificationListener [message #224243 is a reply to message #224176] |
Fri, 03 April 2009 09:50 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hi all again,
In order to known the element which has been changed in the UML resource
(R2), I am trying to get the last executed command or the undoCommand (since
the change done in R2 can be undone) in the
XXXDocumentProvider#handleElementChanged method since this is the method
which is executed when the resource change notification arrived. But the
result of info.getEditingDomain().getCommandStack().getMostRecentComma nd()
is null. Could anybody explain me why? is there any other way to get the
element which has changed in other resource?
Some help would be appreciated!!
Best regards,
Bego
|
|
|
Re: regarding ResourceSetModificationListener [message #224431 is a reply to message #224237] |
Mon, 06 April 2009 11:39 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hi Alex,
I have not managed to get the element which has changed from other Resource
in the ResourceSet by listening ResourceSet modifications. Now, I am trying
adding an adapter to the EObject which belong to other resource (for
instance, a UML class diagram) when it is linked to my model (as I explained
in a previous post, in my metamodel de Artifact EClass is linked to a
generic EObject). By adding this adapter I hoped to receive the change
notifications from this EObject. However, the only notification sended is
REMOVING_ADAPTER. I really do not understand what it is happening. Could
you help me?
Thanks in advance!!
Bego
|
|
|
|
Re: regarding ResourceSetModificationListener [message #224512 is a reply to message #224445] |
Mon, 06 April 2009 15:54 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hello Alex,
I have tryed it. I have defined a new subclass of EContentAdapter and I have
added it to the list of ResourceSet adapters. I have defined the
NotificationFilter as ANY just to print the information received in the
Notification parameter of the method notifyChanged when something changes in
a Resource. The problem is that I do not receive the information I need, for
instance the SET event of any EObject which belongs to other diagram. The
notifier of the SET event is the Resource which has changed but I need to
know the specific element which has changed in that Resource.
I am sending attached an excerpt from the metamodel to better explain the
problem. As the attached figure shows, the Artifact class in my metamodel is
linked to an EObject from any other metamodel. If something in this EObject
changes (for instance the name of the class in a UML class diagram), the
object of A class has to know it since it is related to the changed
Artefact by means of the Trace relationship.
I hope I explain myself ...
Thank you very much for your time!!
Bego
|
|
|
|
Re: regarding ResourceSetModificationListener [message #224544 is a reply to message #224521] |
Mon, 06 April 2009 16:53 |
Eclipse User |
|
|
|
Originally posted by: bmoros.um.es
Hello Alex,
Yes, I did. Since this solution did not work for me, this is the reason why
I tryed to add a listener directly to the EObject linked to the Artifact
when it is set. But it does not work either.
I am really stuck!!
Thank you very much for your time.
"Alex Shatalin" <vano@borland.com> escribi
|
|
|
Powered by
FUDForum. Page generated in 0.04466 seconds