function ModeApplier(model, codeMirror, options) {
		options = options || {};
		this.model = model;
		this.codeMirror = codeMirror;
		this.isWhitespaceVisible = (typeof options.whitespacesVisible === "undefined" ? false : options.whitespacesVisible);
		
		this.mode = null;
		this.isModeLoaded = false;
		this.lines = []; // Array of {style: Array, eolState: state}
		this.dirtyLines = [];
		this.startLine = Number.MAX_VALUE;
		this.endLine = -1;
		this.timer = null;

		this.initialize(model);
	}
/**
	 * @name orion.mirror.ModeApplier
	 * @class Driver for CodeMirror modes.
	 * @description A <code>ModeApplier</code> listens to text changes on a {@link orion.editor.TextModel} and drives
	 * a CodeMirror mode to calculate highlighting in response to the change. Clients can use the highlighting information
	 * to style a {@link orion.editor.TextView}.
	 * 
	 * <p>After a change is made to the {@link orion.editor.TextModel}, ModeApplier immediately updates the highlighting 
	 * information for a small portion of the file around where the change occurred. Successive portions of the file are
	 * updated by short jobs that run periodically to avoid slowing down the rest of the application.</p>
	 * 
	 * <p>A {@link #event:HighlightEvent} event is dispatched every time the ModeApplier updates highlighting information for
	 * a portion of the file. The event contains information about which lines were highlighted. The style for any highlighted
	 * line can be obtained by calling {@link #getLineStyle}.</p>
	 * 
	 * @param {orion.editor.TextModel} model The text model to listen to.
	 * @param {orion.mirror.Mirror} mirror The {@link orion.mirror.Mirror} to use for loading modes.
	 * @param {Object} [options]
	 * <!-- @param {Boolean} [options.whitespacesVisible] If <code>true</code>, causes ModeApplier 
	 * to generate style regions for any whitespace characters that are not claimed as tokens by the mode. -->
	 * @borrows orion.editor.EventTarget#addEventListener as #addEventListener
	 * @borrows orion.editor.EventTarget#removeEventListener as #removeEventListener
	 * @borrows orion.editor.EventTarget#dispatchEvent as #dispatchEvent
	 */
@name orion.mirror.ModeApplier
@class Driver for CodeMirror modes.
@description A ModeApplier listens to text changes on a  orion.editor.TextModel and drives
a CodeMirror mode to calculate highlighting in response to the change. Clients can use the highlighting information
to style a  orion.editor.TextView.

After a change is made to the  orion.editor.TextModel, ModeApplier immediately updates the highlighting
information for a small portion of the file around where the change occurred. Successive portions of the file are
updated by short jobs that run periodically to avoid slowing down the rest of the application.

A  #event:HighlightEvent event is dispatched every time the ModeApplier updates highlighting information for
a portion of the file. The event contains information about which lines were highlighted. The style for any highlighted
line can be obtained by calling  #getLineStyle.

@param {orion.editor.TextModel} model The text model to listen to.
@param {orion.mirror.Mirror} mirror The  orion.mirror.Mirror to use for loading modes.
@param {Object} [options]
<!-- @param {Boolean} [options.whitespacesVisible] If true, causes ModeApplier
to generate style regions for any whitespace characters that are not claimed as tokens by the mode.
@name orion . mirror . ModeApplier @class Driver for CodeMirror modes . @description A ModeApplier listens to text changes on a orion . editor . TextModel and drives a CodeMirror mode to calculate highlighting in response to the change . Clients can use the highlighting information to style a orion . editor . TextView . After a change is made to the orion . editor . TextModel ModeApplier immediately updates the highlighting information for a small portion of the file around where the change occurred . Successive portions of the file are updated by short jobs that run periodically to avoid slowing down the rest of the application . A #event : HighlightEvent event is dispatched every time the ModeApplier updates highlighting information for a portion of the file . The event contains information about which lines were highlighted . The style for any highlighted line can be obtained by calling #getLineStyle . @param { orion . editor . TextModel } model The text model to listen to . @param { orion . mirror . Mirror } mirror The orion . mirror . Mirror to use for loading modes . @param { Object } [ options ] <! -- @param { Boolean } [ options . whitespacesVisible ] If true causes ModeApplier to generate style regions for any whitespace characters that are not claimed as tokens by the mode .
function ModeApplier(model, codeMirror, options) {
		options = options || {};
		this.model = model;
		this.codeMirror = codeMirror;
		this.isWhitespaceVisible = (typeof options.whitespacesVisible === "undefined" ? false : options.whitespacesVisible);
		this.mode = null;
		this.isModeLoaded = false;
		this.lines = []; 
		this.dirtyLines = [];
		this.startLine = Number.MAX_VALUE;
		this.endLine = -1;
		this.timer = null;
		this.initialize(model);
	}
function ModeApplier ( model , codeMirror , options ) { options = options || { } ; this . model = model ; this . codeMirror = codeMirror ; this . isWhitespaceVisible = ( typeof options . whitespacesVisible === "undefined" ? false : options . whitespacesVisible ) ; this . mode = null ; this . isModeLoaded = false ; this . lines = [ ] ; this . dirtyLines = [ ] ; this . startLine = Number . MAX_VALUE ; this . endLine = - 1 ; this . timer = null ; this . initialize ( model ) ; }
@name orion.mirror.ModeApplier
 @class Driver for CodeMirror modes.
@name orion . mirror . ModeApplier @class Driver for CodeMirror modes .
// Array of {style: Array, eolState: state}