OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 update() { | 69 update() { |
70 this.database.executeSql( | 70 this.database.executeSql( |
71 'SELECT rowid, * FROM "' + this._escapeTableName(this.tableName) + '"',
this._queryFinished.bind(this), | 71 'SELECT rowid, * FROM "' + this._escapeTableName(this.tableName) + '"',
this._queryFinished.bind(this), |
72 this._queryError.bind(this)); | 72 this._queryError.bind(this)); |
73 } | 73 } |
74 | 74 |
75 _queryFinished(columnNames, values) { | 75 _queryFinished(columnNames, values) { |
76 this.detachChildWidgets(); | 76 this.detachChildWidgets(); |
77 this.element.removeChildren(); | 77 this.element.removeChildren(); |
78 | 78 |
79 this._dataGrid = UI.SortableDataGrid.create(columnNames, values); | 79 this._dataGrid = DataGrid.SortableDataGrid.create(columnNames, values); |
80 this._visibleColumnsInput.setVisible(!!this._dataGrid); | 80 this._visibleColumnsInput.setVisible(!!this._dataGrid); |
81 if (!this._dataGrid) { | 81 if (!this._dataGrid) { |
82 this._emptyWidget = new UI.EmptyWidget(Common.UIString('The ā%sā\ntable is
empty.', this.tableName)); | 82 this._emptyWidget = new UI.EmptyWidget(Common.UIString('The ā%sā\ntable is
empty.', this.tableName)); |
83 this._emptyWidget.show(this.element); | 83 this._emptyWidget.show(this.element); |
84 return; | 84 return; |
85 } | 85 } |
86 this._dataGrid.asWidget().show(this.element); | 86 this._dataGrid.asWidget().show(this.element); |
87 this._dataGrid.autoSizeColumns(5); | 87 this._dataGrid.autoSizeColumns(5); |
88 | 88 |
89 this._columnsMap = new Map(); | 89 this._columnsMap = new Map(); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 this.element.appendChild(errorMsgElement); | 134 this.element.appendChild(errorMsgElement); |
135 } | 135 } |
136 | 136 |
137 /** | 137 /** |
138 * @param {!Common.Event} event | 138 * @param {!Common.Event} event |
139 */ | 139 */ |
140 _refreshButtonClicked(event) { | 140 _refreshButtonClicked(event) { |
141 this.update(); | 141 this.update(); |
142 } | 142 } |
143 }; | 143 }; |
OLD | NEW |