public void addComponentListeners ( ) { // avoid duplicate registration removeListeners ( ) ; for ( final AbstractField < ? > field : allComponents ) { if ( field instanceof TextChangeNotifier ) { ( ( TextChangeNotifier ) field ) . addTextChangeListener ( new ChangeListener ( field ) ) ; } if ( field instanceof Table ) { ( ( Table ) field ) . addItemSetChangeListener ( new ChangeListener ( field ) ) ; } field . addValueChangeListener ( new ChangeListener ( field ) ) ; } }
adds a listener to a component . Depending on the type of component a valueChange - textChange - or itemSetChangeListener will be added .