use of org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand in project statecharts by Yakindu.
the class VertexEditHelper method getDestroyDependentsCommand.
@Override
protected ICommand getDestroyDependentsCommand(DestroyDependentsRequest req) {
Vertex elementToDestroy = (Vertex) req.getElementToDestroy();
EList<Transition> incomingTransitions = elementToDestroy.getIncomingTransitions();
if (incomingTransitions.size() != 0) {
CompositeCommand compoundCommand = new CompositeCommand("Delete vertex");
for (Transition transition : incomingTransitions) {
DestroyElementCommand destroyCommand = new DestroyElementCommand(new DestroyElementRequest(transition, false));
compoundCommand.add(destroyCommand);
}
return compoundCommand;
}
return super.getDestroyDependentsCommand(req);
}
Aggregations