private void waitForAttributePatternMatcher ( String attributeName , String pattern , long timeout , boolean waitCondition ) throws WidgetException { long start = System . currentTimeMillis ( ) ; long end = start + timeout ; while ( System . currentTimeMillis ( ) < end ) { String attribute = getAttribute ( attributeName ) ; if ( attribute != null && attribute . matches ( pattern ) == waitCondition ) return ; try { Thread . sleep ( DEFAULT_INTERVAL ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( e ) ; } } throw new TimeOutException ( "waitForAttribute " + " : timeout : Locator : " + locator + " Attribute : " + attributeName ) ; }
Matches an attribute value to a pattern that is passed .