@ Override protected void toggleTooltip ( Node reference , Control below ) { String fieldTooltip = field . getTooltip ( ) ; if ( ( reference . isFocused ( ) || reference . isHover ( ) ) && ( ! fieldTooltip . equals ( "" ) || field . getErrorMessages ( ) . size ( ) > 0 ) ) { tooltip . setText ( ( ! fieldTooltip . equals ( "" ) ? fieldTooltip + "\n" : "" ) + String . join ( "\n" , field . getErrorMessages ( ) ) ) ; if ( tooltip . isShowing ( ) ) { return ; } Point2D p = below . localToScene ( 0.0 , 0.0 ) ; tooltip . show ( reference . getScene ( ) . getWindow ( ) , p . getX ( ) + reference . getScene ( ) . getX ( ) + reference . getScene ( ) . getWindow ( ) . getX ( ) , p . getY ( ) + reference . getScene ( ) . getY ( ) + reference . getScene ( ) . getWindow ( ) . getY ( ) + below . getHeight ( ) + 5 ) ; } else { tooltip . hide ( ) ; } }
Sets the error message as tooltip for the matching control .