public class ValidationServiceImpl extends Object implements ValidationService, IncrementalValidationService
Constructor and Description |
---|
ValidationServiceImpl() |
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 |
childViewModelContextAdded(ViewModelContext childContext)
This method is called whenever a new
ViewModelContext is added as a child context to the root
ViewModelContext this GlobalViewModelService belongs to. |
void |
deregisterValidationListener(ViewValidationListener listener)
Deregisters the given listener.
|
void |
deregisterValidationUpdateListener(ValidationUpdateListener listener)
De-register a listener for incremental validation updates.
|
void |
dispose()
Dispose.
|
int |
getPriority()
Returns the priority for this view service.
|
protected ViewSubstitutionLabelProviderFactory |
getSubstitutionLabelProviderFactory()
Returns a
ViewSubstitutionLabelProviderFactory , if any is registered. |
void |
instantiate(ViewModelContext context)
Instantiate the view service.
|
void |
notifyListeners()
Notifies all listeners.
|
void |
registerValidationListener(ViewValidationListener listener)
Registers a listener that will receive
Diagnostic s with severity
higher than Diagnostic#OK . |
void |
registerValidationUpdateListener(ValidationUpdateListener listener)
Register a listener for incremental validation updates.
|
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.
|
void |
validate(org.eclipse.emf.ecore.EObject eObject)
Validate the given eObject.
|
protected void |
warn(String messageKey,
Object... arguments)
Issue a warning composed of the indicated localized string with positional
arguments . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSubstitutionLabelProvider
public void instantiate(ViewModelContext context)
ViewModelService
instantiate
in interface ViewModelService
context
- the ViewModelContext
public void dispose()
ViewModelService
dispose
in interface ViewModelService
public int getPriority()
ViewModelService
getPriority
in interface ViewModelService
public void validate(Collection<org.eclipse.emf.ecore.EObject> eObjects)
ValidationService
validate
in interface ValidationService
eObjects
- the eObjects to validatepublic void validate(org.eclipse.emf.ecore.EObject eObject)
eObject
- the eObject to validatepublic void notifyListeners()
public void addValidationProvider(ValidationProvider validationProvider)
ValidationService
addValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to addpublic void addValidationProvider(ValidationProvider validationProvider, boolean revalidate)
ValidationService
addValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to addrevalidate
- whether to revalidate the domain model after the provider has been addedpublic void removeValidationProvider(ValidationProvider validationProvider)
ValidationService
removeValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to removepublic void removeValidationProvider(ValidationProvider validationProvider, boolean revalidate)
ValidationService
removeValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to removerevalidate
- whether to revalidate the domain model after the provider has been removedpublic void registerValidationListener(ViewValidationListener listener)
ValidationService
Diagnostic
s with severity
higher than Diagnostic#OK
. After
registration the listener's ViewValidationListener.onNewValidation(java.util.Set)
will be called with
current
results.registerValidationListener
in interface ValidationService
listener
- the listener to registerpublic void deregisterValidationListener(ViewValidationListener listener)
ValidationService
deregisterValidationListener
in interface ValidationService
listener
- the listener to deregisterpublic void childViewModelContextAdded(ViewModelContext childContext)
GlobalViewModelService
ViewModelContext
is added as a child context to the root
ViewModelContext
this GlobalViewModelService
belongs to.childViewModelContextAdded
in interface GlobalViewModelService
childContext
- The ViewModelContext
that was added.protected ViewSubstitutionLabelProviderFactory getSubstitutionLabelProviderFactory()
ViewSubstitutionLabelProviderFactory
, if any is registered.ViewSubstitutionLabelProviderFactory
, if any is available,
null
otherwiseprotected void warn(String messageKey, Object... arguments)
arguments
.messageKey
- key to look up in the host bundle's localizationsarguments
- zero-indexed arguments to substitute, if any, in the stringpublic void registerValidationUpdateListener(ValidationUpdateListener listener)
IncrementalValidationService
registerValidationUpdateListener
in interface IncrementalValidationService
listener
- the incremental validation listenerpublic void deregisterValidationUpdateListener(ValidationUpdateListener listener)
IncrementalValidationService
deregisterValidationUpdateListener
in interface IncrementalValidationService
listener
- the incremental validation listenerCopyright © 2019. All rights reserved.