public class ValidationServiceImpl extends Object implements ValidationService, EMFFormsContextListener
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 |
childContextAdded(VElement parentElement,
EMFFormsViewContext childContext)
Called when a child context is added.
|
void |
childContextDisposed(EMFFormsViewContext childContext)
Called when a child context is disposed.
|
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 |
contextDispose()
Called by the context when the dispose is running.
|
void |
contextInitialised()
Called by the context when the initialization has finished.
|
void |
deregisterValidationListener(ViewValidationListener listener)
Deregisters the given listener.
|
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 |
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.
|
public void instantiate(ViewModelContext context)
instantiate
in interface ViewModelService
context
- the ViewModelContext
ViewModelService.instantiate(org.eclipse.emf.ecp.view.spi.context.ViewModelContext)
public void dispose()
dispose
in interface ViewModelService
ViewModelService.dispose()
public int getPriority()
getPriority
in interface ViewModelService
ViewModelService.getPriority()
public void validate(Collection<org.eclipse.emf.ecore.EObject> eObjects)
validate
in interface ValidationService
eObjects
- the eObjects to validateValidationService.validate(java.util.Collection)
public void validate(org.eclipse.emf.ecore.EObject eObject)
eObject
- the eObject to validatepublic void notifyListeners()
public void addValidationProvider(ValidationProvider validationProvider)
addValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to addValidationService.addValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider)
public void addValidationProvider(ValidationProvider validationProvider, boolean revalidate)
addValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to addrevalidate
- whether to revalidate the domain model after the provider has been addedValidationService.addValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider,
boolean)
public void removeValidationProvider(ValidationProvider validationProvider)
removeValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to removeValidationService.removeValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider)
public void removeValidationProvider(ValidationProvider validationProvider, boolean revalidate)
removeValidationProvider
in interface ValidationService
validationProvider
- the ValidationProvider
to removerevalidate
- whether to revalidate the domain model after the provider has been removedValidationService.removeValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider,
boolean)
public void 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.registerValidationListener
in interface ValidationService
listener
- the listener to registerValidationService.registerValidationListener(org.eclipse.emf.ecp.view.spi.validation.ViewValidationListener)
public void deregisterValidationListener(ViewValidationListener listener)
deregisterValidationListener
in interface ValidationService
listener
- the listener to deregisterValidationService.deregisterValidationListener(org.eclipse.emf.ecp.view.spi.validation.ViewValidationListener)
public void childViewModelContextAdded(ViewModelContext childContext)
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.GlobalViewModelService.childViewModelContextAdded(org.eclipse.emf.ecp.view.spi.context.ViewModelContext)
public void childContextAdded(VElement parentElement, EMFFormsViewContext childContext)
childContextAdded
in interface EMFFormsContextListener
parentElement
- The VElement
that is associated with the child contextchildContext
- The EMFFormsViewContext
that was addedEMFFormsContextListener.childContextAdded(org.eclipse.emf.ecp.view.spi.model.VElement,
org.eclipse.emfforms.spi.core.services.view.EMFFormsViewContext)
public void childContextDisposed(EMFFormsViewContext childContext)
childContextDisposed
in interface EMFFormsContextListener
childContext
- The EMFFormsViewContext
that was disposedEMFFormsContextListener.childContextDisposed(org.eclipse.emfforms.spi.core.services.view.EMFFormsViewContext)
public void contextInitialised()
contextInitialised
in interface EMFFormsContextListener
EMFFormsContextListener.contextInitialised()
public void contextDispose()
contextDispose
in interface EMFFormsContextListener
EMFFormsContextListener.contextDispose()
protected ViewSubstitutionLabelProviderFactory getSubstitutionLabelProviderFactory()
ViewSubstitutionLabelProviderFactory
, if any is registered.ViewSubstitutionLabelProviderFactory
, if any is available,
null
otherwiseCopyright © 2018. All rights reserved.