OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) IBM Corp. 2009 All rights reserved. | 2 * Copyright (C) IBM Corp. 2009 All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.SidebarPane} | 33 * @extends {WebInspector.SidebarPane} |
34 */ | 34 */ |
35 WebInspector.WatchExpressionsSidebarPane = function() | 35 WebInspector.WatchExpressionsSidebarPane = function() |
36 { | 36 { |
37 WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions
")); | 37 WebInspector.SidebarPane.call(this, WebInspector.UIString("Watch Expressions
")); |
38 | 38 |
39 this.section = new WebInspector.WatchExpressionsSection(); | 39 /** @type {!WebInspector.ObjectPropertiesMemento} */ |
| 40 this.memento = new WebInspector.ObjectPropertiesMemento(); |
| 41 |
| 42 this.section = new WebInspector.WatchExpressionsSection(this.memento); |
40 this.bodyElement.appendChild(this.section.element); | 43 this.bodyElement.appendChild(this.section.element); |
41 | 44 |
42 var refreshButton = this.titleElement.createChild("button", "pane-title-butt
on refresh"); | 45 var refreshButton = this.titleElement.createChild("button", "pane-title-butt
on refresh"); |
43 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this
), false); | 46 refreshButton.addEventListener("click", this._refreshButtonClicked.bind(this
), false); |
44 refreshButton.title = WebInspector.UIString("Refresh"); | 47 refreshButton.title = WebInspector.UIString("Refresh"); |
45 | 48 |
46 var addButton = this.titleElement.createChild("button", "pane-title-button a
dd"); | 49 var addButton = this.titleElement.createChild("button", "pane-title-button a
dd"); |
47 addButton.addEventListener("click", this._addButtonClicked.bind(this), false
); | 50 addButton.addEventListener("click", this._addButtonClicked.bind(this), false
); |
48 addButton.title = WebInspector.UIString("Add watch expression"); | 51 addButton.title = WebInspector.UIString("Add watch expression"); |
49 | 52 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 event.consume(); | 96 event.consume(); |
94 this.refreshExpressions(); | 97 this.refreshExpressions(); |
95 }, | 98 }, |
96 | 99 |
97 __proto__: WebInspector.SidebarPane.prototype | 100 __proto__: WebInspector.SidebarPane.prototype |
98 } | 101 } |
99 | 102 |
100 /** | 103 /** |
101 * @constructor | 104 * @constructor |
102 * @extends {WebInspector.PropertiesSection} | 105 * @extends {WebInspector.PropertiesSection} |
| 106 * @param {!WebInspector.ObjectPropertiesMemento} memento |
103 */ | 107 */ |
104 WebInspector.WatchExpressionsSection = function() | 108 WebInspector.WatchExpressionsSection = function(memento) |
105 { | 109 { |
106 this._watchObjectGroupId = "watch-group"; | 110 this._watchObjectGroupId = "watch-group"; |
107 | 111 |
108 WebInspector.PropertiesSection.call(this, ""); | 112 WebInspector.PropertiesSection.call(this, ""); |
| 113 |
| 114 this.memento = memento; |
| 115 |
109 this.treeElementConstructor = WebInspector.ObjectPropertyTreeElement; | 116 this.treeElementConstructor = WebInspector.ObjectPropertyTreeElement; |
110 this.skipProto = false; | 117 this.skipProto = false; |
111 | 118 |
112 this.emptyElement = createElementWithClass("div", "info"); | 119 this.emptyElement = createElementWithClass("div", "info"); |
113 this.emptyElement.textContent = WebInspector.UIString("No Watch Expressions"
); | 120 this.emptyElement.textContent = WebInspector.UIString("No Watch Expressions"
); |
114 | 121 |
115 /** @type {!Array.<string>} */ | 122 /** @type {!Array.<string>} */ |
116 this.watchExpressions = WebInspector.settings.watchExpressions.get(); | 123 this.watchExpressions = WebInspector.settings.watchExpressions.get(); |
117 | 124 |
118 this.headerElement.className = "hidden"; | 125 this.headerElement.className = "hidden"; |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 */ | 487 */ |
481 applyExpression: function(expression) | 488 applyExpression: function(expression) |
482 { | 489 { |
483 expression = expression.trim(); | 490 expression = expression.trim(); |
484 this.property.name = expression || null; | 491 this.property.name = expression || null; |
485 this.treeOutline.section.updateExpression(this, expression); | 492 this.treeOutline.section.updateExpression(this, expression); |
486 }, | 493 }, |
487 | 494 |
488 __proto__: WebInspector.ObjectPropertyTreeElement.prototype | 495 __proto__: WebInspector.ObjectPropertyTreeElement.prototype |
489 } | 496 } |
OLD | NEW |