Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.eclipse.emf.ecp.view.internal.validation
Class ValidationServiceImpl

    java.lang.Object
      org.eclipse.emf.ecp.view.internal.validation.ValidationServiceImpl

All Implemented Interfaces:
  GlobalViewModelService, ViewModelService, ValidationService

    public class ValidationServiceImpl

extends Object
implements ValidationService

Validation service that, once instantiated, synchronizes the validation result of a model element with its Renderable.

Author:
  Eugen Neufeld

Constructor Summary
`ValidationServiceImpl()`

Method Summary
`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` | `dispose()` Dispose.
`org.eclipse.emf.common.util.Diagnostic` | `getDiagnosticForEObject(org.eclipse.emf.ecore.EObject object)` Computes the `Diagnostic` for the given eObject.
`int` | `getPriority()` Returns the priority for this view service.
`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.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ValidationServiceImpl

    public ValidationServiceImpl()

Method Detail

### instantiate

    public void instantiate(ViewModelContext context)

  Instantiate the view service.

  Specified by:
    `instantiate` in interface `ViewModelService`
  Parameters:
    `context` - the `ViewModelContext`
  See Also:
    `ViewModelService.instantiate(org.eclipse.emf.ecp.view.spi.context.ViewModelContext)`

### dispose

    public void dispose()

  Dispose.

  Specified by:
    `dispose` in interface `ViewModelService`
  See Also:
    `ViewModelService.dispose()`

### getPriority

    public int getPriority()

  Returns the priority for this view service.

  Specified by:
    `getPriority` in interface `ViewModelService`
  Returns:
    the priority
  See Also:
    `ViewModelService.getPriority()`

### validate

    public void validate(Collection<org.eclipse.emf.ecore.EObject> eObjects)

  Validates all given eObjects.

  Specified by:
    `validate` in interface `ValidationService`
  Parameters:
    `eObjects` - the eObjects to validate
  See Also:
    `ValidationService.validate(java.util.Collection)`

### validate

    public void validate(org.eclipse.emf.ecore.EObject eObject)

  Validate the given eObject.

  Parameters:
    `eObject` - the eObject to validate

### notifyListeners

    public void notifyListeners()

  Notifies all listeners.

### getDiagnosticForEObject

    public org.eclipse.emf.common.util.Diagnostic getDiagnosticForEObject(org.eclipse.emf.ecore.EObject object)

  Computes the `Diagnostic` for the given eObject.

  Parameters:
    `object` - the eObject to validate
  Returns:
    the diagnostic

### addValidationProvider

    public void addValidationProvider(ValidationProvider validationProvider)

  Adds a validation provider to the list of known validation providers. The domain model will be revalidated after the provider has been added.

  Specified by:
    `addValidationProvider` in interface `ValidationService`
  Parameters:
    `validationProvider` - the `ValidationProvider` to add
  See Also:
    `ValidationService.addValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider)`

### addValidationProvider

    public void addValidationProvider(ValidationProvider validationProvider,
                                      boolean revalidate)

  Adds a validation provider to the list of known validation providers.

  Specified by:
    `addValidationProvider` in interface `ValidationService`
  Parameters:
    `validationProvider` - the `ValidationProvider` to add
    `revalidate` - whether to revalidate the domain model after the provider has been added
  See Also:
    `ValidationService.addValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider, boolean)`

### removeValidationProvider

    public void removeValidationProvider(ValidationProvider validationProvider)

  Removes a validation provider from the list of known validation providers.

  Specified by:
    `removeValidationProvider` in interface `ValidationService`
  Parameters:
    `validationProvider` - the `ValidationProvider` to remove
  See Also:
    `ValidationService.removeValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider)`

### removeValidationProvider

    public void removeValidationProvider(ValidationProvider validationProvider,
                                         boolean revalidate)

  Removes a validation provider from the list of known validation providers. The domain model will be revalidated after the provider has been removed

  Specified by:
    `removeValidationProvider` in interface `ValidationService`
  Parameters:
    `validationProvider` - the `ValidationProvider` to remove
    `revalidate` - whether to revalidate the domain model after the provider has been removed
  See Also:
    `ValidationService.removeValidationProvider(org.eclipse.emf.ecp.view.spi.validation.ValidationProvider, boolean)`

### registerValidationListener

    public void registerValidationListener(ViewValidationListener listener)

  Registers a listener that will receive `Diagnostic`s with severity higher than `Diagnostic#OK`. After registration the listener's `ViewValidationListener.onNewValidation(java.util.Set)` will be called with current results.

  Specified by:
    `registerValidationListener` in interface `ValidationService`
  Parameters:
    `listener` - the listener to register
  See Also:
    `ValidationService.registerValidationListener(org.eclipse.emf.ecp.view.spi.validation.ViewValidationListener)`

### deregisterValidationListener

    public void deregisterValidationListener(ViewValidationListener listener)

  Deregisters the given listener.

  Specified by:
    `deregisterValidationListener` in interface `ValidationService`
  Parameters:
    `listener` - the listener to deregister
  See Also:
    `ValidationService.deregisterValidationListener(org.eclipse.emf.ecp.view.spi.validation.ViewValidationListener)`

### childViewModelContextAdded

    public 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.

  Specified by:
    `childViewModelContextAdded` in interface `GlobalViewModelService`
  Parameters:
    `childContext` - The `ViewModelContext` that was added.
  See Also:
    `GlobalViewModelService.childViewModelContextAdded(org.eclipse.emf.ecp.view.spi.context.ViewModelContext)`

Overview | Package | Class | Use | Tree | Deprecated | Index
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2015. All Rights Reserved.