addValidationFunction

fun <S : Text> S.addValidationFunction(func: S.(String) -> Boolean): S

Add a validation function to this text component.

The given func will have the text that is requested as the argument. Return false to cancel the change, meaning the text will not be set.