private void initValidation ( ) { // Create validators and collect the results SimpleProperty < Result > resultCollector1 = new SimpleProperty < Result > ( ) ; createValidator ( textField1 , new StickerFeedback ( textField1 ) , resultCollector1 ) ; SimpleProperty < Result > resultCollector2 = new SimpleProperty < Result > ( ) ; createValidator ( textField2 , new ColorFeedback ( textField2 , false ) , resultCollector2 ) ; SimpleProperty < Result > resultCollector3 = new SimpleProperty < Result > ( ) ; createValidator ( textField3 , new ColorFeedback ( textField3 , true ) , resultCollector3 ) ; SimpleProperty < Result > resultCollector4 = new SimpleProperty < Result > ( ) ; createValidator ( textField4 , new IconFeedback ( textField4 , false ) , resultCollector4 ) ; SimpleProperty < Result > resultCollector5 = new SimpleProperty < Result > ( ) ; createValidator ( textField5 , new IconFeedback ( textField5 , true ) , resultCollector5 ) ; // Enable Apply button only when all fields are valid read ( resultCollector1 , resultCollector2 , resultCollector3 , resultCollector4 , resultCollector5 ) // . transform ( new CollectionElementTransformer < Result , Boolean > ( new ResultToBooleanTransformer ( ) ) ) // . transform ( new AndBooleanAggregator ( ) ) // . write ( new ComponentEnabledProperty ( applyButton ) ) ; }
Initializes the input validation and conditional logic .