|
|
|
|
|
|
|
|
|
Re: delete an element from model [message #1015962 is a reply to message #1015954] |
Mon, 04 March 2013 12:30 |
Joshua Yang Messages: 11 Registered: October 2012 |
Junior Member |
|
|
Hi,Andreas
The code finally executed wihout any error.However it does not gose as i wished.
Here gose my code:
ResourceSet resourceSet = new ResourceSetImpl();
TransactionalEditingDomain domainx = TransactionalEditingDomain.Factory.INSTANCE.createEditingDomain(resourceSet);
Resource res = domainx.loadResource(fileUri.path());
xxxImpl toDelete = (xxxImpl)((xxxModelImpl)res.getContents().get(0)).getXXX().get(0);
IOperationHistory history = OperationHistoryFactory.getOperationHistory();
DestroyElementRequest desRequest = new DestroyElementRequest(toDelete, true);
history.execute(new DestroyElementCommand(desRequest), new NullProgressMonitor(), null);
The code delete the element indeed,while the edgs goes still. it causes the problem that i can not open the file any more.
What should I do ,Could you please give a helping hand?
[Updated on: Mon, 04 March 2013 15:40] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06071 seconds