Correct way to call delete programatically [message #735275] |
Tue, 11 October 2011 07:52  |
Eclipse User |
|
|
|
Hi,
From within a delete feature, I need to delete another object (both from the model and the diagram).
What's the correct (or idiomatic) way to do this?
I guess there are a few possibilities:
- manually delete from the model and then use an update feature to fix the diagram
- manually delete both from the model and the diagram (I think this might have a concurrent modification exception problem)
- directly call the delete feature with a new delete context. This sounds good, but how can you do it? Do you have to go via the FeatureProvider?
Sorry if this is obvious!
Regards,
Adrian.
|
|
|
|
Re: Correct way to call delete programatically [message #735308 is a reply to message #735289] |
Tue, 11 October 2011 09:56  |
Eclipse User |
|
|
|
I've got it now, you're quite right.
The problem I had before was that I was trying to iterate through a list at the same time as removing elements.
The only issue I had was that I needed to use MultiDeleteInfo to avoid the user being asked multiple times to confirm the delete, but it looks like this class is really meant to be internal only.
Thanks for your help,
Adrian.
[Updated on: Tue, 11 October 2011 09:56] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 3.81121 seconds