Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: Source/devtools/front_end/resources/DatabaseTableView.js

Issue 1113813002: [DevTools] Rename View to Widget. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return tableName.replace(/\"/g, "\"\""); 67 return tableName.replace(/\"/g, "\"\"");
68 }, 68 },
69 69
70 update: function() 70 update: function()
71 { 71 {
72 this.database.executeSql("SELECT rowid, * FROM \"" + this._escapeTableNa me(this.tableName) + "\"", this._queryFinished.bind(this), this._queryError.bind (this)); 72 this.database.executeSql("SELECT rowid, * FROM \"" + this._escapeTableNa me(this.tableName) + "\"", this._queryFinished.bind(this), this._queryError.bind (this));
73 }, 73 },
74 74
75 _queryFinished: function(columnNames, values) 75 _queryFinished: function(columnNames, values)
76 { 76 {
77 this.detachChildViews(); 77 this.detachChildWidgets();
78 this.element.removeChildren(); 78 this.element.removeChildren();
79 79
80 this._dataGrid = WebInspector.SortableDataGrid.create(columnNames, value s); 80 this._dataGrid = WebInspector.SortableDataGrid.create(columnNames, value s);
81 this._visibleColumnsInput.setVisible(!!this._dataGrid); 81 this._visibleColumnsInput.setVisible(!!this._dataGrid);
82 if (!this._dataGrid) { 82 if (!this._dataGrid) {
83 this._emptyView = new WebInspector.EmptyView(WebInspector.UIString(" The “%s”\ntable is empty.", this.tableName)); 83 this._emptyWidget = new WebInspector.EmptyWidget(WebInspector.UIStri ng("The “%s”\ntable is empty.", this.tableName));
84 this._emptyView.show(this.element); 84 this._emptyWidget.show(this.element);
85 return; 85 return;
86 } 86 }
87 this._dataGrid.show(this.element); 87 this._dataGrid.show(this.element);
88 this._dataGrid.autoSizeColumns(5); 88 this._dataGrid.autoSizeColumns(5);
89 89
90 this._columnsMap = new Map(); 90 this._columnsMap = new Map();
91 for (var i = 1; i < columnNames.length; ++i) 91 for (var i = 1; i < columnNames.length; ++i)
92 this._columnsMap.set(columnNames[i], String(i)); 92 this._columnsMap.set(columnNames[i], String(i));
93 this._lastVisibleColumns = ""; 93 this._lastVisibleColumns = "";
94 var visibleColumnsText = this._visibleColumnsSetting.get()[this.tableNam e] || ""; 94 var visibleColumnsText = this._visibleColumnsSetting.get()[this.tableNam e] || "";
(...skipping 26 matching lines...) Expand all
121 return; 121 return;
122 var visibleColumnsRegistry = this._visibleColumnsSetting.get(); 122 var visibleColumnsRegistry = this._visibleColumnsSetting.get();
123 visibleColumnsRegistry[this.tableName] = text; 123 visibleColumnsRegistry[this.tableName] = text;
124 this._visibleColumnsSetting.set(visibleColumnsRegistry); 124 this._visibleColumnsSetting.set(visibleColumnsRegistry);
125 this._dataGrid.setColumnsVisiblity(columnsVisibility); 125 this._dataGrid.setColumnsVisiblity(columnsVisibility);
126 this._lastVisibleColumns = newVisibleColumns; 126 this._lastVisibleColumns = newVisibleColumns;
127 }, 127 },
128 128
129 _queryError: function(error) 129 _queryError: function(error)
130 { 130 {
131 this.detachChildViews(); 131 this.detachChildWidgets();
132 this.element.removeChildren(); 132 this.element.removeChildren();
133 133
134 var errorMsgElement = createElement("div"); 134 var errorMsgElement = createElement("div");
135 errorMsgElement.className = "storage-table-error"; 135 errorMsgElement.className = "storage-table-error";
136 errorMsgElement.textContent = WebInspector.UIString("An error occurred t rying to\nread the “%s” table.", this.tableName); 136 errorMsgElement.textContent = WebInspector.UIString("An error occurred t rying to\nread the “%s” table.", this.tableName);
137 this.element.appendChild(errorMsgElement); 137 this.element.appendChild(errorMsgElement);
138 }, 138 },
139 139
140 _refreshButtonClicked: function(event) 140 _refreshButtonClicked: function(event)
141 { 141 {
142 this.update(); 142 this.update();
143 }, 143 },
144 144
145 __proto__: WebInspector.VBox.prototype 145 __proto__: WebInspector.VBox.prototype
146 } 146 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/resources/DatabaseQueryView.js ('k') | Source/devtools/front_end/resources/FileContentView.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698