public void add ( ValidationResultsModel validationResultsModel ) { if ( children . add ( validationResultsModel ) ) { validationResultsModel . addValidationListener ( this ) ; validationResultsModel . addPropertyChangeListener ( HAS_ERRORS_PROPERTY , this ) ; validationResultsModel . addPropertyChangeListener ( HAS_WARNINGS_PROPERTY , this ) ; validationResultsModel . addPropertyChangeListener ( HAS_INFO_PROPERTY , this ) ; if ( ( validationResultsModel . getMessageCount ( ) > 0 ) ) fireChangedEvents ( ) ; } }
Add a validationResultsModel as a child to this one . Attach listeners and if it already has messages fire events .