private void applyEnableAction ( final WComponent target , final boolean enabled ) { // Found Disableable component if ( target instanceof Disableable ) { target . setValidate ( enabled ) ; ( ( Disableable ) target ) . setDisabled ( ! enabled ) ; } else if ( target instanceof Container ) { // Apply to any Disableable children Container cont = ( Container ) target ; final int size = cont . getChildCount ( ) ; for ( int i = 0 ; i < size ; i ++ ) { WComponent child = cont . getChildAt ( i ) ; applyEnableAction ( child , enabled ) ; } } }
Apply the enable action against the target and its children .