Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Delete Parent Container shape if Child Shapes are deleted
Delete Parent Container shape if Child Shapes are deleted [message #1682169] Tue, 17 March 2015 16:22 Go to next message
Abhishek Chakraborty is currently offline Abhishek ChakrabortyFriend
Messages: 69
Registered: July 2009
Location: Cologne, Germany
Member

I have this feature requirement where I am trying to delete the parent container ,when child Shape is deleted. But I am getting this error even though I have used
TransactionalEditingDomain editingDomain = TransactionUtil.getEditingDomain(containerObject);
editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) {
@Override
protected void doExecute() {
}
});

to execute my code


I am trying to call the deleteFeature for the parent containerShape from the moveShape() of the Child.



!ENTRY org.eclipse.graphiti.ui 4 0 2015-03-17 17:11:53.604
!MESSAGE GFCommandStack.execute(Command) java.lang.IllegalStateException: Cannot modify resource set without a write transaction
!STACK 0
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.assertWriting(TransactionChangeRecorder.java:348)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.appendNotification(TransactionChangeRecorder.java:302)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.processObjectNotification(TransactionChangeRecorder.java:284)
at org.eclipse.emf.transaction.impl.TransactionChangeRecorder.notifyChanged(TransactionChangeRecorder.java:240)
at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1027)
at org.eclipse.emf.common.notify.impl.NotificationImpl.dispatch(NotificationImpl.java:1032)
at org.eclipse.graphiti.mm.pictograms.impl.PictogramElementImpl.setGraphicsAlgorithm(PictogramElementImpl.java:211)
at org.eclipse.graphiti.mm.pictograms.impl.PictogramElementImpl.eUnset(PictogramElementImpl.java:398)
at org.eclipse.graphiti.mm.pictograms.impl.AnchorContainerImpl.eUnset(AnchorContainerImpl.java:160)
at org.eclipse.graphiti.mm.pictograms.impl.ShapeImpl.eUnset(ShapeImpl.java:201)
at org.eclipse.graphiti.mm.pictograms.impl.ContainerShapeImpl.eUnset(ContainerShapeImpl.java:160)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eUnset(BasicEObjectImpl.java:1154)
at org.eclipse.emf.ecore.util.EcoreUtil.remove(EcoreUtil.java:3301)
at org.eclipse.emf.ecore.util.EcoreUtil.delete(EcoreUtil.java:3451)
at org.eclipse.graphiti.internal.services.impl.PeServiceImpl.deletePictogramElement(PeServiceImpl.java:348)
at org.eclipse.graphiti.features.impl.DefaultRemoveFeature.remove(DefaultRemoveFeature.java:83)
at org.eclipse.graphiti.pattern.AbstractPattern.remove(AbstractPattern.java:859)
at org.eclipse.graphiti.pattern.RemoveFeatureForPattern.remove(RemoveFeatureForPattern.java:69)
at org.eclipse.graphiti.ui.features.DefaultDeleteFeature.delete(DefaultDeleteFeature.java:136)
at org.eclipse.graphiti.pattern.AbstractPattern.delete(AbstractPattern.java:762)
at com.silexica.mapping.editor.pattern.SchedulerPattern.delete(SchedulerPattern.java:162)
at org.eclipse.graphiti.pattern.DeleteFeatureForPattern.delete(DeleteFeatureForPattern.java:68)
at com.silexica.mapping.editor.pattern.ProcessorPattern$1.run(ProcessorPattern.java:199)
at org.eclipse.emf.transaction.impl.TransactionalEditingDomainImpl.runExclusive(TransactionalEditingDomainImpl.java:328)
at com.silexica.mapping.editor.pattern.ProcessorPattern.postMoveShape(ProcessorPattern.java:178)
at org.eclipse.graphiti.pattern.AbstractPattern.moveShape(AbstractPattern.java:352)
at com.silexica.mapping.editor.pattern.ProcessorPattern.moveShape(ProcessorPattern.java:154)
at org.eclipse.graphiti.pattern.MoveShapeFeatureForPattern.moveShape(MoveShapeFeatureForPattern.java:55)
at org.eclipse.graphiti.internal.command.MoveShapeFeatureCommandWithContext.execute(MoveShapeFeatureCommandWithContext.java:81)


Regards,
Abhishek Chakraborty
Re: Delete Parent Container shape if Child Shapes are deleted [message #1683924 is a reply to message #1682169] Wed, 18 March 2015 08:02 Go to previous message
Krisztian Koncz is currently offline Krisztian KonczFriend
Messages: 31
Registered: September 2014
Location: Budapest
Member

I'm not sure, but i think you try to execute this command in another command. (Features are wrapped in commands). Have you tried in the DeleteFeature's postDelete hook?

[Updated on: Wed, 18 March 2015 09:00]

Report message to a moderator

Previous Topic:Disable a connection
Next Topic:org.eclipse.graphiti.ui refactoring
Goto Forum:
  


Current Time: Thu Jun 21 16:32:42 GMT 2018

Powered by FUDForum. Page generated in 0.01844 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top