final void revalidate(){
  for (  Document doc : documents) {
    if (doc.getLength() == 0) {
      component.setEnabled(false);
      return;
    }
  }
  component.setEnabled(true);
}

final void revalidate ( ) { for ( Document doc : documents ) { if ( doc . getLength ( ) == 0 ) { component . setEnabled ( false ) ; return ; } } component . setEnabled ( true ) ; }
do a full document state check and set the component status according to the result .
