Re: Is it possible to create a connection before its source and target elements are created? [message #96553] |
Thu, 25 January 2007 05:18  |
Eclipse User |
|
|
|
Originally posted by: xiaoxiaoleemin.gmail.com
Hi, Alex
Thank you very much. And now I know doDefaultElementCreation() is called
by the doExecuteWithResult() method of CreateElementCommand, which itself
is
TransactionalCommand, so I can call the EMF API directly.
I tried as you told me, now when I create NMessage from one NClass to
another NClass, the result is as the attachment shows.
(1) two Life Node is created, and a connection(the longer one, just call
it NodeConnection) is also created . I think that's because I create two
LifeNode and a NMessage object by the EMF API, the corresponding carnonical
edit policy create views for them. And that's just the expected result I
need.
(2) another connection(the shorter one,just call it ClassConnection) is
created too. I think it is created by some Creation Edit Policy. If I do
nothing in the doDefaultElementCreation() method and just return NULL, this
shorter connection can be created too.
The result I expected should only show views described in (1), the
shorter connection is not needed. But I find the persistence work of
NMessage object is done when the shorter connection is created, if I delete
it, the persistence information of NMessage is missing too.
I read the connection problem described at "
https://bugs.eclipse.org/bugs/show_bug.cgi?id=148021", and I think my
problem is not the same as it. I think the work did by CarnonicalEditPolicy
is just what I need, so I can't modify its shouldHandleNotificationEvent().
So if I want to delete the shorter connection, and I also need the
persistence work done by GMF(or EMF), what should I do next?
Thank you very much:)
"Alex Shatalin" <vano@borland.com> д
Attachment: a.JPG
(Size: 15.32KB, Downloaded 123 times)
|
|
|
Re: Is it possible to create a connection before its source and target elements are created? [message #96678 is a reply to message #96553] |
Thu, 25 January 2007 07:36  |
Eclipse User |
|
|
|
Hello Min,
AFAIU you have to align GraphicalNodeEditPolicy behaviour with the modified
NodeItemSemanticEditPolicy. In particular, getView() method of GraphicalNodeEditPolicy
installed on source/target NClass should return notation model elements referencing
corresponding Life Node instead of current implementation returning notation
model element for source/target NClass. I suggest to patch this method only
for the request creating NMessage link – default implementation should be
used for the rest of requests.
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.03070 seconds