void addMarkers(Token tok){
  SyntaxDocument sDoc=(SyntaxDocument)pane.getDocument();
  sDoc.readLock();
  String text=tok.getText(sDoc);
  Iterator<Token> it=sDoc.getTokens(0,sDoc.getLength());
  while (it.hasNext()) {
    Token nextToken=it.next();
    if (nextToken.length == tok.length && text.equals(nextToken.getText(sDoc))) {
      Markers.markToken(pane,nextToken,marker);
    }
  }
  sDoc.readUnlock();
}

void addMarkers ( Token tok ) { SyntaxDocument sDoc = ( SyntaxDocument ) pane . getDocument ( ) ; sDoc . readLock ( ) ; String text = tok . getText ( sDoc ) ; Iterator < Token > it = sDoc . getTokens ( 0 , sDoc . getLength ( ) ) ; while ( it . hasNext ( ) ) { Token nextToken = it . next ( ) ; if ( nextToken . length == tok . length && text . equals ( nextToken . getText ( sDoc ) ) ) { Markers . markToken ( pane , nextToken , marker ) ; } } sDoc . readUnlock ( ) ; }
add highlights for the given pattern
