private void zEventTextFieldChanged ( ) { if ( settings == null ) { return ; } // Skip this function if it should not be run. if ( skipTextFieldChangedFunctionWhileTrue ) { return ; } // Gather some variables that we will need. String dateText = dateTextField . getText ( ) ; boolean textIsEmpty = dateText . trim ( ) . isEmpty ( ) ; DateVetoPolicy vetoPolicy = settings . getVetoPolicy ( ) ; boolean nullIsAllowed = settings . getAllowEmptyDates ( ) ; // If the text is not empty, then try to parse the date. LocalDate parsedDate = null ; if ( ! textIsEmpty ) { parsedDate = InternalUtilities . getParsedDateOrNull ( dateText , settings . getFormatForDatesCommonEra ( ) , settings . getFormatForDatesBeforeCommonEra ( ) , settings . getFormatsForParsing ( ) , settings . getLocale ( ) ) ; } // If the date was parsed successfully, then check it against the veto policy. boolean dateIsVetoed = false ; if ( parsedDate != null ) { dateIsVetoed = InternalUtilities . isDateVetoed ( vetoPolicy , parsedDate ) ; } // If the date is a valid empty date, then set the last valid date to null. if ( textIsEmpty && nullIsAllowed ) { zInternalSetLastValidDateAndNotifyListeners ( null ) ; } // If the date is a valid parsed date, then store the last valid date. if ( ( ! textIsEmpty ) && ( parsedDate != null ) && ( dateIsVetoed == false ) ) { zInternalSetLastValidDateAndNotifyListeners ( parsedDate ) ; } // Draw the date status indications for the user. zDrawTextFieldIndicators ( ) ; // Fire a change event for beans binding. firePropertyChange ( "text" , null , dateTextField . getText ( ) ) ; }
zEventTextFieldChanged This is called whenever the text in the date picker text field has changed whether programmatically or by the user .