ui

## Class ValidatedChangeListener

- java.lang.Object
- - ui.ValidatedChangeListener

- All Implemented Interfaces:
    javafx.beans.value.ChangeListener<java.lang.Boolean>

      public class ValidatedChangeListener
      extends java.lang.Object
      implements javafx.beans.value.ChangeListener<java.lang.Boolean>

  Custom change listener, which adds the functionality of: showing alert dialogs with hints if validation failed, disabling the confirmation button if validation failed, re-enabling the confirmation button if validation succeeded.
  Author:
    David Hudec (dwdization@gmail.com)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private javafx.scene.control.Button` | `btnToDisable`
    `private ValidatedField` | `field`
    `private javafx.scene.control.TextInputControl` | `textField`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ValidatedChangeListener(javafx.scene.control.TextInputControl textField, ValidatedField field, javafx.scene.control.Button btnToDisable)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changed(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> arg0, java.lang.Boolean oldPropertyValue, java.lang.Boolean newPropertyValue)` Validates the field and raises an alert warning dialog in case of failure.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### btnToDisable

          private javafx.scene.control.Button btnToDisable

    - #### field

          private ValidatedField field

    - #### textField

          private javafx.scene.control.TextInputControl textField

  - ### Constructor Detail

    - #### ValidatedChangeListener

          ValidatedChangeListener(javafx.scene.control.TextInputControl textField,
                                  ValidatedField field,
                                  javafx.scene.control.Button btnToDisable)

      Parameters:
        `textField` - Text element extending TextInputControl to be validated
        `field` - One of ValidatedFields to provide hints and examples about the validation process
        `btnToDisable` - button to disable/enable in case of validation failure/success

  - ### Method Detail

    - #### changed

          public void changed(javafx.beans.value.ObservableValue<? extends java.lang.Boolean> arg0,
                              java.lang.Boolean oldPropertyValue,
                              java.lang.Boolean newPropertyValue)

      Validates the field and raises an alert warning dialog in case of failure. Field name, value restrictions and correct example are displayed.
      Specified by:
        `changed` in interface `javafx.beans.value.ChangeListener<java.lang.Boolean>`