/** * @since 2.1.0 */ public static string getValueLabel(EDataType eDataType, object value, Dictionary <object, object> context) { /* * if (context != null) * { * SubstitutionLabelProvider substitutionlabelProvider = (SubstitutionLabelProvider)context.get(SubstitutionLabelProvider.class); * if (substitutionlabelProvider != null) * { * return substitutionlabelProvider.getValueLabel(eDataType, value); * } * } */ return(EcoreUtil.convertToString(eDataType, value)); }
/** * @since 2.1.0 */ public static string getObjectLabel(EObject eObject, Dictionary <object, object> context) { /* * if (context != null) * { * SubstitutionLabelProvider substitutionlabelProvider = (SubstitutionLabelProvider)context[typeof(SubstitutionLabelProvider)]; * if (substitutionlabelProvider != null) * { * return substitutionlabelProvider.getObjectLabel(eObject); * } * } */ return(EcoreUtil.getIdentification(eObject)); }
public bool validate_UniqueID(EObject eObject, DiagnosticChain diagnostics, Dictionary <object, object> context) { bool result = true; String id = EcoreUtil.getID(eObject); if (id != null) { Resource resource = eObject.eResource(); if (resource != null) { EObject otherEObject = resource.getEObject(id); if (eObject != otherEObject && otherEObject != null) { result = false; if (diagnostics != null) { diagnostics.add (createDiagnostic (BasicDiagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__UNIQUE_ID, "_UI_DuplicateID_diagnostic", new Object[] { id, getObjectLabel(eObject, context), getObjectLabel(otherEObject, context) }, new Object[] { eObject, otherEObject, id }, context)); } } } } return(result); }