/** * Returns a translated message with the given substitutions. * The {@link #getEcoreResourceLocator() Ecore resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getEcoreString(String key, Object [] substitutions) { return getString(getEcoreResourceLocator(), key, substitutions); }
/** * Returns a translated message with the given substitutions. * The {@link #getEcoreResourceLocator() Ecore resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getEcoreString(String key, Object [] substitutions) { return getString(getEcoreResourceLocator(), key, substitutions); }
/** * @since 2.6 */ protected void reportConstraintDelegateException(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateException_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { value, throwable })); }
/** * @since 2.6 */ protected void reportConstraintDelegateException(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateException_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { value, throwable })); }
/** * @since 2.6 */ protected void reportConstraintDelegateException(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateException_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { eObject, throwable })); }
/** * @since 2.6 */ protected void reportConstraintDelegateException(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateException_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { eObject, throwable })); }
/** * Creates a new {@link BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) basic diagnostic}. * If the source is {@link #DIAGNOSTIC_SOURCE "org.eclipse.emf.ecore"}, * it calls {@link #getEcoreString(String, Object[])}; * otherwise it calls {@link #getString(String, Object[])}. * @param severity an indicator of the severity of the problem. * @param source the unique identifier of the source. * @param code the source-specific identity code. * @param messageKey the key of the message. * @param messageSubstitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @param data the data associated with the diagnostic * @param context a place to cache information, if it's <code>null</code>, no cache is supported. * @return a new diagnostic. * @see BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) * @since 2.4 */ protected BasicDiagnostic createDiagnostic (int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data, Map<Object, Object> context) { String message = DIAGNOSTIC_SOURCE.equals(source) ? getEcoreString(messageKey, messageSubstitutions) : getString(messageKey, messageSubstitutions); return new BasicDiagnostic(severity, source, code, message, data); }
/** * Creates a new {@link BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) basic diagnostic}. * If the source is {@link #DIAGNOSTIC_SOURCE "org.eclipse.emf.ecore"}, * it calls {@link #getEcoreString(String, Object[])}; * otherwise it calls {@link #getString(String, Object[])}. * @param severity an indicator of the severity of the problem. * @param source the unique identifier of the source. * @param code the source-specific identity code. * @param messageKey the key of the message. * @param messageSubstitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @param data the data associated with the diagnostic * @param context a place to cache information, if it's <code>null</code>, no cache is supported. * @return a new diagnostic. * @see BasicDiagnostic#BasicDiagnostic(int, String, int, String, Object[]) * @since 2.4 */ protected BasicDiagnostic createDiagnostic (int severity, String source, int code, String messageKey, Object[] messageSubstitutions, Object[] data, Map<Object, Object> context) { String message = DIAGNOSTIC_SOURCE.equals(source) ? getEcoreString(messageKey, messageSubstitutions) : getString(messageKey, messageSubstitutions); return new BasicDiagnostic(severity, source, code, message, data); }
if (choices.size() == 2) return getString(ecoreResourceLocator, "_UI_SimpleListTrivialOr_composition", new Object[] { result, quote(i.next(), quote) }); if (i.hasNext()) result = getString(ecoreResourceLocator, "_UI_SimpleListIntermediate_composition", new Object[] { result, next }); result = getString(ecoreResourceLocator, inclusive ? "_UI_SimpleListTailAnd_composition" : "_UI_SimpleListTailOr_composition", new Object[] { result, next }); result = getString(ecoreResourceLocator, "_UI_SimpleListTailLimited_composition", new Object[] { result }); break;
/** * Returns a translated message with the given substitutions. * The {@link #getResourceLocator() resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getString(String key, Object [] substitutions) { return getString(isEcoreString(key) ? getEcoreResourceLocator() : getResourceLocator(), key, substitutions); }
/** * Returns a translated message with the given substitutions. * The {@link #getResourceLocator() resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getString(String key, Object [] substitutions) { return getString(isEcoreString(key) ? getEcoreResourceLocator() : getResourceLocator(), key, substitutions); }
/** * @since 2.6 */ protected void reportConstraintDelegateViolation(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_GenericConstraint_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context) }), new Object [] { value })); }
/** * @since 2.6 */ protected void reportConstraintDelegateNotFound(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateNotFound_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), validationDelegate }), new Object [] { eObject })); }
/** * @since 2.6 */ protected void reportConstraintDelegateViolation(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_GenericConstraint_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context) }), new Object [] { eObject })); }
/** * @since 2.6 */ protected void reportConstraintDelegateNotFound(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateNotFound_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context), validationDelegate }), new Object [] { value })); }
/** * @since 2.6 */ protected void reportConstraintDelegateViolation(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_GenericConstraint_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context) }), new Object [] { eObject })); }
/** * @since 2.6 */ protected void reportConstraintDelegateNotFound(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateNotFound_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context), validationDelegate }), new Object [] { value })); }
/** * @since 2.6 */ protected void reportConstraintDelegateViolation(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_GenericConstraint_diagnostic", new Object[] { constraint, getValueLabel(eDataType, value, context) }), new Object [] { value })); }
/** * @since 2.6 */ protected void reportConstraintDelegateNotFound(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateNotFound_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), validationDelegate }), new Object [] { eObject })); }