private void checkElements( int offset, int length ) {
        int end = offset + length;
        Document document = jText.getDocument();
        Element element;

        do{
            try {
                // We need to use a ParagraphElement because a CharacterElement produce problems with formating in a word
                element = ((AbstractDocument)document).getParagraphElement( offset );
            } catch( java.lang.Exception ex ) {
                return;
            }
            checkElement( element );
            int endOffset = element.getEndOffset();
            offset = endOffset > offset ? endOffset : offset + 1;
        }while( offset <= end && offset < document.getLength() );
    }