private void zEventTextFieldChanged ( ) { // Skip this function if it should not be run. if ( skipTextFieldChangedFunctionWhileTrue ) { return ; } // Gather some variables that we will need. String timeText = timeTextField . getText ( ) ; boolean textIsEmpty = timeText . trim ( ) . isEmpty ( ) ; TimeVetoPolicy vetoPolicy = settings . getVetoPolicy ( ) ; boolean nullIsAllowed = settings . getAllowEmptyTimes ( ) ; // If the text is not empty, then try to parse the time. LocalTime parsedTime = null ; if ( ! textIsEmpty ) { parsedTime = InternalUtilities . getParsedTimeOrNull ( timeText , settings . getFormatForDisplayTime ( ) , settings . getFormatForMenuTimes ( ) , settings . formatsForParsing , settings . getLocale ( ) ) ; } // If the time was parsed successfully, then check it against the veto policy. boolean timeIsVetoed = false ; if ( parsedTime != null ) { timeIsVetoed = InternalUtilities . isTimeVetoed ( vetoPolicy , parsedTime ) ; } // If the time is a valid empty time, then set the last valid time to null. if ( textIsEmpty && nullIsAllowed ) { zInternalSetLastValidTimeAndNotifyListeners ( null ) ; } // If the time is a valid parsed time, then store the last valid time. if ( ( ! textIsEmpty ) && ( parsedTime != null ) && ( timeIsVetoed == false ) ) { zInternalSetLastValidTimeAndNotifyListeners ( parsedTime ) ; } // Draw the time status indications for the user. zDrawTextFieldIndicators ( ) ; // Fire the text change event for beans binding. firePropertyChange ( "text" , null , timeTextField . getText ( ) ) ; }
zEventTextFieldChanged This is called whenever the text in the time picker text field has changed whether programmatically or by the user .