bundles/org.eclipse.orion.client.editor/web/orion/editor/textView.js
function(model) {
			if (model === this._model) { return; }
			model = model || new mTextModel.TextModel();
			this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
			this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
			var oldLineCount = this._model.getLineCount();
			var oldCharCount = this._model.getCharCount();
			var newLineCount = model.getLineCount();
			var newCharCount = model.getCharCount();
			var newText = model.getText();
			var e = {
				type: "ModelChanging", //$NON-NLS-1$
				text: newText,
				start: 0,
				removedCharCount: oldCharCount,
				addedCharCount: newCharCount,
				removedLineCount: oldLineCount,
				addedLineCount: newLineCount
			};
			this.onModelChanging(e);
			this._model = model;
			e = {
				type: "ModelChanged", //$NON-NLS-1$
				start: 0,
				removedCharCount: oldCharCount,
				addedCharCount: newCharCount,
				removedLineCount: oldLineCount,
				addedLineCount: newLineCount
			};
			this.onModelChanged(e); 
			this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
			this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
			this._reset();
			this._update();
		}
function(model) {
			if (model === this._model) { return; }
			model = model || new mTextModel.TextModel();
			this._model.removeEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
			this._model.removeEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
			var oldLineCount = this._model.getLineCount();
			var oldCharCount = this._model.getCharCount();
			var newLineCount = model.getLineCount();
			var newCharCount = model.getCharCount();
			var newText = model.getText();
			var e = {
				type: "ModelChanging", //$NON-NLS-1$
				text: newText,
				start: 0,
				removedCharCount: oldCharCount,
				addedCharCount: newCharCount,
				removedLineCount: oldLineCount,
				addedLineCount: newLineCount
			};
			this.onModelChanging(e);
			this._model = model;
			e = {
				type: "ModelChanged", //$NON-NLS-1$
				start: 0,
				removedCharCount: oldCharCount,
				addedCharCount: newCharCount,
				removedLineCount: oldLineCount,
				addedLineCount: newLineCount
			};
			this.onModelChanged(e); 
			this._model.addEventListener("preChanging", this._modelListener.onChanging); //$NON-NLS-1$
			this._model.addEventListener("postChanged", this._modelListener.onChanged); //$NON-NLS-1$
			this._reset();
			this._update();
		}
function ( model ) { if ( model === this . _model ) { return ; } model = model || new mTextModel . TextModel ( ) ; this . _model . removeEventListener ( "preChanging" , this . _modelListener . onChanging ) ; //$NON-NLS-1$ this . _model . removeEventListener ( "postChanged" , this . _modelListener . onChanged ) ; //$NON-NLS-1$ var oldLineCount = this . _model . getLineCount ( ) ; var oldCharCount = this . _model . getCharCount ( ) ; var newLineCount = model . getLineCount ( ) ; var newCharCount = model . getCharCount ( ) ; var newText = model . getText ( ) ; var e = { type : "ModelChanging" , //$NON-NLS-1$ text : newText , start : 0 , removedCharCount : oldCharCount , addedCharCount : newCharCount , removedLineCount : oldLineCount , addedLineCount : newLineCount } ; this . onModelChanging ( e ) ; this . _model = model ; e = { type : "ModelChanged" , //$NON-NLS-1$ start : 0 , removedCharCount : oldCharCount , addedCharCount : newCharCount , removedLineCount : oldLineCount , addedLineCount : newLineCount } ; this . onModelChanged ( e ) ; this . _model . addEventListener ( "preChanging" , this . _modelListener . onChanging ) ; //$NON-NLS-1$ this . _model . addEventListener ( "postChanged" , this . _modelListener . onChanged ) ; //$NON-NLS-1$ this . _reset ( ) ; this . _update ( ) ; }
Sets the text model of the text view.

@param {orion.editor.TextModel} model the text model of the view.
Sets the text model of the text view .