code: private void applyHighlighting( String content, int line ) throws BadLocationException {
          int startOffset = rootElement.getElement(line).getStartOffset();
          int endOffset = rootElement.getElement(line).getEndOffset() - 1;
          int lineLength = endOffset - startOffset;
          int contentLength = content.length();
          if (endOffset >= contentLength)
              endOffset = contentLength - 1;
          // check for multi line comments
          // (always set the comment attribute for the entire line)
          if (endingMultiLineComment(content, startOffset, endOffset) || isMultiLineComment()
                  || startingMultiLineComment(content, startOffset, endOffset)) {
              doc.setCharacterAttributes(startOffset, endOffset - startOffset + 1, comment, false);
              return;
          }
          // set normal attributes for the line
          doc.setCharacterAttributes(startOffset, lineLength, normal, true);
          // check for single line comment
          int index = content.indexOf(getSingleLineDelimiter(), startOffset);
          if ((index > -1) && (index < endOffset)) {
              doc.setCharacterAttributes(index, endOffset - index + 1, comment, false);
              endOffset = index - 1;
          }
          // check for tokens
          checkForTokens(content, startOffset, endOffset);
      }
docs: /*
  Parse the line to determine the appropriate highlighting