1 /** 2 * @fileoverview Class implements a XML console to pretty 3 * print XML instances in the browser. 4 */ 5 6 goog.provide('xrx.console'); 7 8 9 goog.require('goog.dom'); 10 goog.require('xrx.serialize'); 11 goog.require('xrx.view'); 12 13 14 15 /** 16 * @constructor 17 */ 18 xrx.console = function(element) { 19 20 21 22 goog.base(this, element); 23 }; 24 goog.inherits(xrx.console, xrx.view); 25 26 27 28 xrx.console.prototype.createDom = function() {}; 29 30 31 32 xrx.console.prototype.eventBeforeChange = function() {}; 33 34 35 36 xrx.console.prototype.eventFocus = function() {}; 37 38 39 40 xrx.console.prototype.getValue = function() {}; 41 42 43 44 xrx.console.prototype.setFocus = function() {}; 45 46 47 xrx.console.prototype.setValue = function(xml) { 48 49 goog.dom.setTextContent(this.getElement(), xrx.serialize.indent(xml, 2)); 50 }; 51 52 53 xrx.console.prototype.refresh = function() { 54 var xml = this.getNode().xml(); 55 56 this.setValue(xml); 57 }; 58