Search in sources :

Example 1 with IObserverSet

use of org.jowidgets.util.collection.IObserverSet in project jo-client-platform by jo-source.

the class BeanProxyImpl method getPropertiesListeners.

@SuppressWarnings({ "rawtypes", "unchecked" })
private <PROPERTY_TYPE> IObserverSet<ICustomBeanPropertyListener<BEAN_TYPE, Object>> getPropertiesListeners(final ITypedKey<PROPERTY_TYPE> key) {
    Assert.paramNotNull(key, "key");
    IObserverSet result = customPropertiesListeners.get(key);
    if (result == null) {
        result = ObserverSetFactory.create(IObserverSetFactory.Strategy.LOW_MEMORY);
        customPropertiesListeners.put(key, result);
    }
    return result;
}
Also used : IObserverSet(org.jowidgets.util.collection.IObserverSet)

Example 2 with IObserverSet

use of org.jowidgets.util.collection.IObserverSet in project jo-client-platform by jo-source.

the class BeanProxyImpl method clearValidationResults.

private void clearValidationResults() {
    final boolean hasResults = independentWorstResult.get() != null || validationResults.size() > 0;
    if (hasResults) {
        if (independentWorstResult.get() != null) {
            for (final Entry<String, IObserverSet<IExternalBeanValidator>> entry : externalValidators.entrySet()) {
                final IBeanValidationResult okResult = BeanValidationResult.create(entry.getKey(), ValidationResult.ok());
                for (final IExternalBeanValidator externalValidator : entry.getValue()) {
                    externalValidator.validate(Collections.singletonList(okResult));
                }
            }
        } else {
            for (final String propertyName : validationResults.keySet()) {
                final IBeanValidationResult okResult = BeanValidationResult.create(propertyName, ValidationResult.ok());
                for (final IExternalBeanValidator externalValidator : getRegisteredExternalValidators(propertyName)) {
                    externalValidator.validate(Collections.singletonList(okResult));
                }
            }
        }
        independentWorstResult.set(null);
        validationResults.clear();
        fireValidationConditionsChanged();
    }
}
Also used : IObserverSet(org.jowidgets.util.collection.IObserverSet) IBeanValidationResult(org.jowidgets.cap.common.api.validation.IBeanValidationResult) IExternalBeanValidator(org.jowidgets.cap.ui.api.bean.IExternalBeanValidator)

Aggregations

IObserverSet (org.jowidgets.util.collection.IObserverSet)2 IBeanValidationResult (org.jowidgets.cap.common.api.validation.IBeanValidationResult)1 IExternalBeanValidator (org.jowidgets.cap.ui.api.bean.IExternalBeanValidator)1