OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 this._versionTreeElement = new TreeElement(); | 57 this._versionTreeElement = new TreeElement(); |
58 this._versionTreeElement.selectable = false; | 58 this._versionTreeElement.selectable = false; |
59 this._headersTreeOutline.appendChild(this._versionTreeElement); | 59 this._headersTreeOutline.appendChild(this._versionTreeElement); |
60 | 60 |
61 this.update(database); | 61 this.update(database); |
62 } | 62 } |
63 | 63 |
64 WebInspector.IDBDatabaseView.prototype = { | 64 WebInspector.IDBDatabaseView.prototype = { |
65 /** | 65 /** |
66 * @return {!Array.<!WebInspector.ToolbarItem>} | |
67 */ | |
68 toolbarItems: function() | |
69 { | |
70 return []; | |
71 }, | |
72 | |
73 /** | |
74 * @param {string} name | 66 * @param {string} name |
75 * @param {string} value | 67 * @param {string} value |
76 */ | 68 */ |
77 _formatHeader: function(name, value) | 69 _formatHeader: function(name, value) |
78 { | 70 { |
79 var fragment = createDocumentFragment(); | 71 var fragment = createDocumentFragment(); |
80 fragment.createChild("div", "attribute-name").textContent = name + ":"; | 72 fragment.createChild("div", "attribute-name").textContent = name + ":"; |
81 fragment.createChild("div", "attribute-value source-code").textContent =
value; | 73 fragment.createChild("div", "attribute-value source-code").textContent =
value; |
82 | 74 |
83 return fragment; | 75 return fragment; |
(...skipping 14 matching lines...) Expand all Loading... |
98 this._database = database; | 90 this._database = database; |
99 this._refreshDatabase(); | 91 this._refreshDatabase(); |
100 }, | 92 }, |
101 | 93 |
102 __proto__: WebInspector.VBox.prototype | 94 __proto__: WebInspector.VBox.prototype |
103 } | 95 } |
104 | 96 |
105 | 97 |
106 /** | 98 /** |
107 * @constructor | 99 * @constructor |
108 * @extends {WebInspector.VBox} | 100 * @extends {WebInspector.VBoxWithToolbarItems} |
109 * @param {!WebInspector.IndexedDBModel} model | 101 * @param {!WebInspector.IndexedDBModel} model |
110 * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId | 102 * @param {!WebInspector.IndexedDBModel.DatabaseId} databaseId |
111 * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore | 103 * @param {!WebInspector.IndexedDBModel.ObjectStore} objectStore |
112 * @param {?WebInspector.IndexedDBModel.Index} index | 104 * @param {?WebInspector.IndexedDBModel.Index} index |
113 */ | 105 */ |
114 WebInspector.IDBDataView = function(model, databaseId, objectStore, index) | 106 WebInspector.IDBDataView = function(model, databaseId, objectStore, index) |
115 { | 107 { |
116 WebInspector.VBox.call(this); | 108 WebInspector.VBoxWithToolbarItems.call(this); |
117 this.registerRequiredCSS("resources/indexedDBViews.css"); | 109 this.registerRequiredCSS("resources/indexedDBViews.css"); |
118 | 110 |
119 this._model = model; | 111 this._model = model; |
120 this._databaseId = databaseId; | 112 this._databaseId = databaseId; |
121 this._isIndex = !!index; | 113 this._isIndex = !!index; |
122 | 114 |
123 this.element.classList.add("indexed-db-data-view"); | 115 this.element.classList.add("indexed-db-data-view"); |
124 | 116 |
125 this._createEditorToolbar(); | 117 this._createEditorToolbar(); |
126 | 118 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 */ | 327 */ |
336 function cleared() { | 328 function cleared() { |
337 this._clearButton.setEnabled(true); | 329 this._clearButton.setEnabled(true); |
338 this._updateData(true); | 330 this._updateData(true); |
339 } | 331 } |
340 this._clearButton.setEnabled(false); | 332 this._clearButton.setEnabled(false); |
341 this._model.clearObjectStore(this._databaseId, this._objectStore.name, c
leared.bind(this)); | 333 this._model.clearObjectStore(this._databaseId, this._objectStore.name, c
leared.bind(this)); |
342 }, | 334 }, |
343 | 335 |
344 /** | 336 /** |
| 337 * @override |
345 * @return {!Array.<!WebInspector.ToolbarItem>} | 338 * @return {!Array.<!WebInspector.ToolbarItem>} |
346 */ | 339 */ |
347 toolbarItems: function() | 340 toolbarItems: function() |
348 { | 341 { |
349 return [this._refreshButton, this._clearButton]; | 342 return [this._refreshButton, this._clearButton]; |
350 }, | 343 }, |
351 | 344 |
352 clear: function() | 345 clear: function() |
353 { | 346 { |
354 this._dataGrid.rootNode().removeChildren(); | 347 this._dataGrid.rootNode().removeChildren(); |
355 this._entries = []; | 348 this._entries = []; |
356 }, | 349 }, |
357 | 350 |
358 __proto__: WebInspector.VBox.prototype | 351 __proto__: WebInspector.VBoxWithToolbarItems.prototype |
359 } | 352 } |
360 | 353 |
361 /** | 354 /** |
362 * @constructor | 355 * @constructor |
363 * @extends {WebInspector.DataGridNode} | 356 * @extends {WebInspector.DataGridNode} |
364 * @param {!Object.<string, *>} data | 357 * @param {!Object.<string, *>} data |
365 */ | 358 */ |
366 WebInspector.IDBDataGridNode = function(data) | 359 WebInspector.IDBDataGridNode = function(data) |
367 { | 360 { |
368 WebInspector.DataGridNode.call(this, data, false); | 361 WebInspector.DataGridNode.call(this, data, false); |
(...skipping 19 matching lines...) Expand all Loading... |
388 cell.appendChild(objectElement); | 381 cell.appendChild(objectElement); |
389 break; | 382 break; |
390 default: | 383 default: |
391 } | 384 } |
392 | 385 |
393 return cell; | 386 return cell; |
394 }, | 387 }, |
395 | 388 |
396 __proto__: WebInspector.DataGridNode.prototype | 389 __proto__: WebInspector.DataGridNode.prototype |
397 } | 390 } |
OLD | NEW |