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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 this._clearButton.addEventListener(UI.ToolbarButton.Events.Click, this._clea
rButtonClicked, this); | 105 this._clearButton.addEventListener(UI.ToolbarButton.Events.Click, this._clea
rButtonClicked, this); |
106 | 106 |
107 this._pageSize = 50; | 107 this._pageSize = 50; |
108 this._skipCount = 0; | 108 this._skipCount = 0; |
109 | 109 |
110 this.update(objectStore, index); | 110 this.update(objectStore, index); |
111 this._entries = []; | 111 this._entries = []; |
112 } | 112 } |
113 | 113 |
114 /** | 114 /** |
115 * @return {!UI.DataGrid} | 115 * @return {!DataGrid.DataGrid} |
116 */ | 116 */ |
117 _createDataGrid() { | 117 _createDataGrid() { |
118 var keyPath = this._isIndex ? this._index.keyPath : this._objectStore.keyPat
h; | 118 var keyPath = this._isIndex ? this._index.keyPath : this._objectStore.keyPat
h; |
119 | 119 |
120 var columns = /** @type {!Array<!UI.DataGrid.ColumnDescriptor>} */ ([]); | 120 var columns = /** @type {!Array<!DataGrid.DataGrid.ColumnDescriptor>} */ ([]
); |
121 columns.push({id: 'number', title: Common.UIString('#'), sortable: false, wi
dth: '50px'}); | 121 columns.push({id: 'number', title: Common.UIString('#'), sortable: false, wi
dth: '50px'}); |
122 columns.push( | 122 columns.push( |
123 {id: 'key', titleDOMFragment: this._keyColumnHeaderFragment(Common.UIStr
ing('Key'), keyPath), sortable: false}); | 123 {id: 'key', titleDOMFragment: this._keyColumnHeaderFragment(Common.UIStr
ing('Key'), keyPath), sortable: false}); |
124 if (this._isIndex) { | 124 if (this._isIndex) { |
125 columns.push({ | 125 columns.push({ |
126 id: 'primaryKey', | 126 id: 'primaryKey', |
127 titleDOMFragment: this._keyColumnHeaderFragment(Common.UIString('Primary
key'), this._objectStore.keyPath), | 127 titleDOMFragment: this._keyColumnHeaderFragment(Common.UIString('Primary
key'), this._objectStore.keyPath), |
128 sortable: false | 128 sortable: false |
129 }); | 129 }); |
130 } | 130 } |
131 columns.push({id: 'value', title: Common.UIString('Value'), sortable: false}
); | 131 columns.push({id: 'value', title: Common.UIString('Value'), sortable: false}
); |
132 | 132 |
133 var dataGrid = new UI.DataGrid(columns); | 133 var dataGrid = new DataGrid.DataGrid(columns); |
134 return dataGrid; | 134 return dataGrid; |
135 } | 135 } |
136 | 136 |
137 /** | 137 /** |
138 * @param {string} prefix | 138 * @param {string} prefix |
139 * @param {*} keyPath | 139 * @param {*} keyPath |
140 * @return {!DocumentFragment} | 140 * @return {!DocumentFragment} |
141 */ | 141 */ |
142 _keyColumnHeaderFragment(prefix, keyPath) { | 142 _keyColumnHeaderFragment(prefix, keyPath) { |
143 var keyColumnHeaderFragment = createDocumentFragment(); | 143 var keyColumnHeaderFragment = createDocumentFragment(); |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 clear() { | 334 clear() { |
335 this._dataGrid.rootNode().removeChildren(); | 335 this._dataGrid.rootNode().removeChildren(); |
336 this._entries = []; | 336 this._entries = []; |
337 } | 337 } |
338 }; | 338 }; |
339 | 339 |
340 /** | 340 /** |
341 * @unrestricted | 341 * @unrestricted |
342 */ | 342 */ |
343 Resources.IDBDataGridNode = class extends UI.DataGridNode { | 343 Resources.IDBDataGridNode = class extends DataGrid.DataGridNode { |
344 /** | 344 /** |
345 * @param {!Object.<string, *>} data | 345 * @param {!Object.<string, *>} data |
346 */ | 346 */ |
347 constructor(data) { | 347 constructor(data) { |
348 super(data, false); | 348 super(data, false); |
349 this.selectable = false; | 349 this.selectable = false; |
350 } | 350 } |
351 | 351 |
352 /** | 352 /** |
353 * @override | 353 * @override |
(...skipping 10 matching lines...) Expand all Loading... |
364 cell.removeChildren(); | 364 cell.removeChildren(); |
365 var objectElement = Components.ObjectPropertiesSection.defaultObjectPres
entation(value, undefined, true); | 365 var objectElement = Components.ObjectPropertiesSection.defaultObjectPres
entation(value, undefined, true); |
366 cell.appendChild(objectElement); | 366 cell.appendChild(objectElement); |
367 break; | 367 break; |
368 default: | 368 default: |
369 } | 369 } |
370 | 370 |
371 return cell; | 371 return cell; |
372 } | 372 } |
373 }; | 373 }; |
OLD | NEW |