private void applyStyle() {
        for (SqlChunk chunk : chunks) {
            Style style = null;
            int startPos = chunk.startPos;
            int length   = chunk.length;

            if (chunk.type == TextType.CHARACTER) {
                startPos++;
                length -= 2;
                style = getStyle("Red");
            } else if (chunk.type == TextType.COMMENT) {
                style = getStyle("Green");
            } else if (chunk.type == TextType.FUNCTION) {
                style = getStyle("BlueBold");
            } else if (chunk.type == TextType.KEYWORD) {
                style = getStyle("Blue");
            } else if (chunk.type == TextType.NUMERIC) {
                style = getStyle("Magenta");
            }
            if (style != null) {
                setCharacterAttributes(startPos, length, style, true);
            }
        }
    }