use of org.eclipse.sirius.ext.emf.EReferencePredicate 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 (vpSession != null) {
if (vpModelAccessor == null) {
vpModelAccessor = vpSession.getModelAccessor();
}
if (vpModelAccessor != null) {
vpModelAccessor.eDelete(object, vpSession.getSemanticCrossReferencer(), new EReferencePredicate() {
public boolean apply(EReference reference) {
return DSemanticDecorator.class.isAssignableFrom(reference.getContainerClass());
}
});
}
}
// If this code is executed it means that either the session or the model accessor is null (probably the session)
// We use EcoreUtil.delete() then
EcoreUtil.delete(object, true);
}
use of org.eclipse.sirius.ext.emf.EReferencePredicate in project InformationSystem by ObeoNetwork.
the class DeleteServices 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());
}
});
}
use of org.eclipse.sirius.ext.emf.EReferencePredicate in project InformationSystem by ObeoNetwork.
the class DocumentationLinkImpl method delete.
/**
* {@inheritDoc}
* @see org.obeonetwork.tools.doc.core.DocumentationLink#delete()
*/
public void delete() {
Session session = SessionManager.INSTANCE.getSession(annotation);
if (session != null) {
ModelAccessor vpModelAccessor = session.getModelAccessor();
vpModelAccessor.eDelete(annotation, session.getSemanticCrossReferencer(), new EReferencePredicate() {
public boolean apply(EReference reference) {
return DSemanticDecorator.class.isAssignableFrom(reference.getContainerClass());
}
});
} else {
EcoreUtil.delete(annotation);
}
// $NON-NLS-1$
name = "";
// $NON-NLS-1$
value = "";
annotation = null;
}
use of org.eclipse.sirius.ext.emf.EReferencePredicate 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.ext.emf.EReferencePredicate 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