Deletion of elements and OpenDiagramEditPolicy [message #231242] |
Mon, 25 May 2009 16:42 |
Javier Messages: 57 Registered: July 2009 |
Member |
|
|
Hello.
I have an application in which my Canvas is of the type Task. In the
model, I have a top element Domain, which contain Tasks. In my model, a
Task can contain some Methods, these methods can contain Boxes and in
these boxes I can also add Tasks, but conainment is false, it just can
reference a task. For editing these Tasks, I added an
OpenDiagramEditPolicy to the TaskEditPart, so that if I double-click on
a Task I get an editor in which I can add methods and boxes for that
Task. Now, let's say I delete one task (TASK_1) contained in one box,
and previously I had opened a editor and added methods and boxes to that
task (for example, BOX_2 and TASK_2, TASK_2 is actually contained in the
Domain). The deletion process go to a DestroyElementCommand... I
debugged the code and this command destroys the element and all
incoming/outgoing references. After deleting that Task, everything seems
allright. But my problem comes when I try to save the diagram: it
triggers a Dialog saying that some of the Box element (the one showing a
task in the other diagram) has no associated resource and the diagram
can't be saved. It happens when a Box has a Task... if it doesn't have a
Task, then it works properly. If I look at my Domain element, in the
Task list I still can see TASK_2, but Methods of Task_1 are gone... it
seems like it deleted some things but not all of them.
Does anyone could give me a hint on how to get into this process of
deletion? Because it seems different to the typical implemented on a
ItemSemanticEditPolicy, when it adds the deletion of childNodes (looking
for them in the EditPartRegistry... but now, as the new editor is
closed, its EditPartRegistry just doesn't exist at the moment).
Thanks!
|
|
|
|
Powered by
FUDForum. Page generated in 0.02851 seconds