public interface ValidationService extends GlobalViewModelService
Modifier and Type | Method and Description |
---|---|
void |
addValidationProvider(ValidationProvider validationProvider)
Adds a validation provider to the list of known validation providers.
|
void |
addValidationProvider(ValidationProvider validationProvider,
boolean revalidate)
Adds a validation provider to the list of known validation providers.
|
void |
deregisterValidationListener(ViewValidationListener listener)
Deregisters the given listener.
|
static org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider |
getSubstitutionLabelProvider(EMFFormsViewContext context,
org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
Obtain a substitution label provider suitable for rendering model elements as they
are presented in diagnostics produced by the
ValidationService . |
void |
registerValidationListener(ViewValidationListener listener)
Registers a listener that will receive
Diagnostic s with severity
higher than Diagnostic#OK . |
void |
removeValidationProvider(ValidationProvider validationProvider)
Removes a validation provider from the list of known validation providers.
|
void |
removeValidationProvider(ValidationProvider validationProvider,
boolean revalidate)
Removes a validation provider from the list of known validation providers.
|
void |
validate(Collection<org.eclipse.emf.ecore.EObject> eObjects)
Validates all given eObjects.
|
childViewModelContextAdded
dispose, getPriority, instantiate
void addValidationProvider(ValidationProvider validationProvider)
validationProvider
- the ValidationProvider
to addvoid addValidationProvider(ValidationProvider validationProvider, boolean revalidate)
validationProvider
- the ValidationProvider
to addrevalidate
- whether to revalidate the domain model after the provider has been addedvoid removeValidationProvider(ValidationProvider validationProvider)
validationProvider
- the ValidationProvider
to removevoid removeValidationProvider(ValidationProvider validationProvider, boolean revalidate)
validationProvider
- the ValidationProvider
to removerevalidate
- whether to revalidate the domain model after the provider has been removedvoid registerValidationListener(ViewValidationListener listener)
Diagnostic
s with severity
higher than Diagnostic#OK
. After
registration the listener's ViewValidationListener.onNewValidation(java.util.Set)
will be called with
current
results.listener
- the listener to registervoid deregisterValidationListener(ViewValidationListener listener)
listener
- the listener to deregistervoid validate(Collection<org.eclipse.emf.ecore.EObject> eObjects)
eObjects
- the eObjects to validatestatic org.eclipse.emf.ecore.EValidator.SubstitutionLabelProvider getSubstitutionLabelProvider(EMFFormsViewContext context, org.eclipse.emf.common.notify.AdapterFactory adapterFactory)
ValidationService
.context
- the view model contextadapterFactory
- an adapter factory to use to get item providers for model elementsCopyright © 2019. All rights reserved.