code: function UndoStack (view, size) {
  		this.size = size !== undefined ? size : 100;
  		this.reset();
  		var self = this;
  		this._listener = {
  			onChanging: function(e) {
  				self._onChanging(e);
  			},
  			onDestroy: function(e) {
  				self._onDestroy(e);
  			}
  		};
  		if (view.getModel) {
  			var model = view.getModel();
  			if (model.getBaseModel) {
  				model = model.getBaseModel();
  			}
  			this.model = model;
  			this.setView(view);
  		} else {
  			this.shared = true;
  			this.model = view;
  		}
  		this.model.addEventListener("Changing", this._listener.onChanging); //$NON-NLS-0$
  	}
docs: Constructs a new UndoStack on a text view.
  
  @param {orion.editor.TextView} view the text view for the undo stack.
  @param {Number} [size=100] the size for the undo stack.
  
  @name orion.editor.UndoStack
  @class The UndoStack is used to record the history of a text model associated to an view. Every
  change to the model is added to stack, allowing the application to undo and redo these changes.
  
  <p>
  <b>See:</b><br/>
  {@link orion.editor.TextView}<br/>
  </p>