use of org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor in project InformationSystem by ObeoNetwork.
the class DeleteServices method delete.
private void delete(EObject object, Session session, ModelAccessor modelAccessor) {
Session vpSession = session;
ModelAccessor vpModelAccessor = modelAccessor;
if (vpSession == null) {
vpSession = getSession(object);
}
if (vpModelAccessor == null) {
vpModelAccessor = vpSession.getModelAccessor();
}
vpModelAccessor.eDelete(object, vpSession.getSemanticCrossReferencer(), new EReferencePredicate() {
public boolean apply(EReference reference) {
return DSemanticDecorator.class.isAssignableFrom(reference.getContainerClass());
}
});
}
use of org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor in project InformationSystem by ObeoNetwork.
the class DeleteServices method deleteInteractionUse.
public void deleteInteractionUse(InteractionUse interactionUse) {
if (interactionUse == null) {
return;
}
Session session = SessionManager.INSTANCE.getSession(interactionUse);
ModelAccessor modelAccessor = session.getModelAccessor();
delete(interactionUse.getStartingEnd(), session, modelAccessor);
delete(interactionUse.getFinishingEnd(), session, modelAccessor);
delete(interactionUse, session, modelAccessor);
}
use of org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor in project InformationSystem by ObeoNetwork.
the class TaskUtils method deleteTask.
/**
* Deletes a task and all its attached TaskReference instances
*
* @param task
* Task to be deleted
*/
public void deleteTask(Task task) {
Session session = SessionManager.INSTANCE.getSession(task);
ModelAccessor modelAccessor = session.getModelAccessor();
// Deletion of all TaskReference instances associated with the task
deleteTaskReferences(task, session, modelAccessor);
DeleteUtils.delete(task, session, modelAccessor);
}
use of org.eclipse.sirius.ecore.extender.business.api.accessor.ModelAccessor in project InformationSystem by ObeoNetwork.
the class DeleteUtils method delete.
public static void delete(EObject object, Session session, ModelAccessor modelAccessor) {
Session vpSession = session;
ModelAccessor vpModelAccessor = modelAccessor;
if (vpSession == null) {
vpSession = SessionManager.INSTANCE.getSession(object);
}
if (vpModelAccessor == null) {
vpModelAccessor = vpSession.getModelAccessor();
}
vpModelAccessor.eDelete(object, vpSession.getSemanticCrossReferencer(), new EReferencePredicate() {
public boolean apply(EReference reference) {
return DSemanticDecorator.class.isAssignableFrom(reference.getContainerClass());
}
});
}
Aggregations