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 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * | 10 * |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingRemoved, this._onBindingChanged, this); | 67 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingRemoved, this._onBindingChanged, this); |
68 } else { | 68 } else { |
69 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingCreated, this._onBindingCreated, this); | 69 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingCreated, this._onBindingCreated, this); |
70 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingRemoved, this._onBindingRemoved, this); | 70 WebInspector.persistence.addEventListener(WebInspector.Persistence.Event
s.BindingRemoved, this._onBindingRemoved, this); |
71 } | 71 } |
72 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.NameChanged, this._targetNameChanged, this); | 72 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.NameChanged, this._targetNameChanged, this); |
73 | 73 |
74 WebInspector.targetManager.observeTargets(this); | 74 WebInspector.targetManager.observeTargets(this); |
75 this._resetWorkspace(WebInspector.workspace); | 75 this._resetWorkspace(WebInspector.workspace); |
76 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); | 76 this._workspace.uiSourceCodes().forEach(this._addUISourceCode.bind(this)); |
77 } | 77 }; |
78 | 78 |
79 WebInspector.NavigatorView.Types = { | 79 WebInspector.NavigatorView.Types = { |
80 Category: "category", | 80 Category: "category", |
81 Domain: "domain", | 81 Domain: "domain", |
82 File: "file", | 82 File: "file", |
83 FileSystem: "fs", | 83 FileSystem: "fs", |
84 FileSystemFolder: "fs-folder", | 84 FileSystemFolder: "fs-folder", |
85 Frame: "frame", | 85 Frame: "frame", |
86 NetworkFolder: "nw-folder", | 86 NetworkFolder: "nw-folder", |
87 Root: "root", | 87 Root: "root", |
88 SourceMapFolder: "sm-folder", | 88 SourceMapFolder: "sm-folder", |
89 Worker: "worker" | 89 Worker: "worker" |
90 } | 90 }; |
91 | 91 |
92 /** | 92 /** |
93 * @param {!TreeElement} treeElement | 93 * @param {!TreeElement} treeElement |
94 */ | 94 */ |
95 WebInspector.NavigatorView._treeElementOrder = function(treeElement) | 95 WebInspector.NavigatorView._treeElementOrder = function(treeElement) |
96 { | 96 { |
97 if (treeElement._boostOrder) | 97 if (treeElement._boostOrder) |
98 return 0; | 98 return 0; |
99 | 99 |
100 if (!WebInspector.NavigatorView._typeOrders) { | 100 if (!WebInspector.NavigatorView._typeOrders) { |
(...skipping 19 matching lines...) Expand all Loading... |
120 order += 3; | 120 order += 3; |
121 else if (contentType.isScript()) | 121 else if (contentType.isScript()) |
122 order += 5; | 122 order += 5; |
123 else if (contentType.isStyleSheet()) | 123 else if (contentType.isStyleSheet()) |
124 order += 10; | 124 order += 10; |
125 else | 125 else |
126 order += 15; | 126 order += 15; |
127 } | 127 } |
128 | 128 |
129 return order; | 129 return order; |
130 } | 130 }; |
131 | 131 |
132 /** | 132 /** |
133 * @param {!WebInspector.ContextMenu} contextMenu | 133 * @param {!WebInspector.ContextMenu} contextMenu |
134 */ | 134 */ |
135 WebInspector.NavigatorView.appendAddFolderItem = function(contextMenu) | 135 WebInspector.NavigatorView.appendAddFolderItem = function(contextMenu) |
136 { | 136 { |
137 function addFolder() | 137 function addFolder() |
138 { | 138 { |
139 WebInspector.isolatedFileSystemManager.addFileSystem(); | 139 WebInspector.isolatedFileSystemManager.addFileSystem(); |
140 } | 140 } |
141 | 141 |
142 var addFolderLabel = WebInspector.UIString("Add folder to workspace"); | 142 var addFolderLabel = WebInspector.UIString("Add folder to workspace"); |
143 contextMenu.appendItem(addFolderLabel, addFolder); | 143 contextMenu.appendItem(addFolderLabel, addFolder); |
144 } | 144 }; |
145 | 145 |
146 /** | 146 /** |
147 * @param {!WebInspector.ContextMenu} contextMenu | 147 * @param {!WebInspector.ContextMenu} contextMenu |
148 * @param {string=} path | 148 * @param {string=} path |
149 */ | 149 */ |
150 WebInspector.NavigatorView.appendSearchItem = function(contextMenu, path) | 150 WebInspector.NavigatorView.appendSearchItem = function(contextMenu, path) |
151 { | 151 { |
152 function searchPath() | 152 function searchPath() |
153 { | 153 { |
154 WebInspector.AdvancedSearchView.openSearch("", path.trim()); | 154 WebInspector.AdvancedSearchView.openSearch("", path.trim()); |
155 } | 155 } |
156 | 156 |
157 var searchLabel = WebInspector.UIString("Search in folder"); | 157 var searchLabel = WebInspector.UIString("Search in folder"); |
158 if (!path || !path.trim()) { | 158 if (!path || !path.trim()) { |
159 path = "*"; | 159 path = "*"; |
160 searchLabel = WebInspector.UIString("Search in all files"); | 160 searchLabel = WebInspector.UIString("Search in all files"); |
161 } | 161 } |
162 contextMenu.appendItem(searchLabel, searchPath); | 162 contextMenu.appendItem(searchLabel, searchPath); |
163 } | 163 }; |
164 | 164 |
165 WebInspector.NavigatorView.prototype = { | 165 WebInspector.NavigatorView.prototype = { |
166 /** | 166 /** |
167 * @param {!WebInspector.Event} event | 167 * @param {!WebInspector.Event} event |
168 */ | 168 */ |
169 _onBindingCreated: function(event) | 169 _onBindingCreated: function(event) |
170 { | 170 { |
171 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data
); | 171 var binding = /** @type {!WebInspector.PersistenceBinding} */(event.data
); |
172 this._removeUISourceCode(binding.network); | 172 this._removeUISourceCode(binding.network); |
173 }, | 173 }, |
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 */ | 834 */ |
835 _targetNameChanged: function(event) | 835 _targetNameChanged: function(event) |
836 { | 836 { |
837 var target = /** @type {!WebInspector.Target} */ (event.data); | 837 var target = /** @type {!WebInspector.Target} */ (event.data); |
838 var targetNode = this._rootNode.child("target:" + target.id()); | 838 var targetNode = this._rootNode.child("target:" + target.id()); |
839 if (targetNode) | 839 if (targetNode) |
840 targetNode.setTitle(target.name()); | 840 targetNode.setTitle(target.name()); |
841 }, | 841 }, |
842 | 842 |
843 __proto__: WebInspector.VBox.prototype | 843 __proto__: WebInspector.VBox.prototype |
844 } | 844 }; |
845 | 845 |
846 /** | 846 /** |
847 * @param {!TreeElement} treeElement1 | 847 * @param {!TreeElement} treeElement1 |
848 * @param {!TreeElement} treeElement2 | 848 * @param {!TreeElement} treeElement2 |
849 * @return {number} | 849 * @return {number} |
850 */ | 850 */ |
851 WebInspector.NavigatorView._treeElementsCompare = function compare(treeElement1,
treeElement2) | 851 WebInspector.NavigatorView._treeElementsCompare = function compare(treeElement1,
treeElement2) |
852 { | 852 { |
853 var typeWeight1 = WebInspector.NavigatorView._treeElementOrder(treeElement1)
; | 853 var typeWeight1 = WebInspector.NavigatorView._treeElementOrder(treeElement1)
; |
854 var typeWeight2 = WebInspector.NavigatorView._treeElementOrder(treeElement2)
; | 854 var typeWeight2 = WebInspector.NavigatorView._treeElementOrder(treeElement2)
; |
855 | 855 |
856 var result; | 856 var result; |
857 if (typeWeight1 > typeWeight2) | 857 if (typeWeight1 > typeWeight2) |
858 return 1; | 858 return 1; |
859 if (typeWeight1 < typeWeight2) | 859 if (typeWeight1 < typeWeight2) |
860 return -1; | 860 return -1; |
861 return treeElement1.titleAsText().compareTo(treeElement2.titleAsText()); | 861 return treeElement1.titleAsText().compareTo(treeElement2.titleAsText()); |
862 } | 862 }; |
863 | 863 |
864 /** | 864 /** |
865 * @constructor | 865 * @constructor |
866 * @extends {TreeElement} | 866 * @extends {TreeElement} |
867 * @param {!WebInspector.NavigatorView} navigatorView | 867 * @param {!WebInspector.NavigatorView} navigatorView |
868 * @param {string} type | 868 * @param {string} type |
869 * @param {string} title | 869 * @param {string} title |
870 * @param {function(boolean)=} hoverCallback | 870 * @param {function(boolean)=} hoverCallback |
871 */ | 871 */ |
872 WebInspector.NavigatorFolderTreeElement = function(navigatorView, type, title, h
overCallback) | 872 WebInspector.NavigatorFolderTreeElement = function(navigatorView, type, title, h
overCallback) |
873 { | 873 { |
874 TreeElement.call(this, "", true); | 874 TreeElement.call(this, "", true); |
875 this.listItemElement.classList.add("navigator-" + type + "-tree-item", "navi
gator-folder-tree-item"); | 875 this.listItemElement.classList.add("navigator-" + type + "-tree-item", "navi
gator-folder-tree-item"); |
876 this._nodeType = type; | 876 this._nodeType = type; |
877 this.title = title; | 877 this.title = title; |
878 this.tooltip = title; | 878 this.tooltip = title; |
879 this.createIcon(); | 879 this.createIcon(); |
880 this._navigatorView = navigatorView; | 880 this._navigatorView = navigatorView; |
881 this._hoverCallback = hoverCallback; | 881 this._hoverCallback = hoverCallback; |
882 } | 882 }; |
883 | 883 |
884 WebInspector.NavigatorFolderTreeElement.prototype = { | 884 WebInspector.NavigatorFolderTreeElement.prototype = { |
885 onpopulate: function() | 885 onpopulate: function() |
886 { | 886 { |
887 this._node.populate(); | 887 this._node.populate(); |
888 }, | 888 }, |
889 | 889 |
890 onattach: function() | 890 onattach: function() |
891 { | 891 { |
892 this.collapse(); | 892 this.collapse(); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 */ | 938 */ |
939 _mouseLeave: function(event) | 939 _mouseLeave: function(event) |
940 { | 940 { |
941 if (!this._hoverCallback) | 941 if (!this._hoverCallback) |
942 return; | 942 return; |
943 this._hovered = false; | 943 this._hovered = false; |
944 this._hoverCallback(false); | 944 this._hoverCallback(false); |
945 }, | 945 }, |
946 | 946 |
947 __proto__: TreeElement.prototype | 947 __proto__: TreeElement.prototype |
948 } | 948 }; |
949 | 949 |
950 /** | 950 /** |
951 * @constructor | 951 * @constructor |
952 * @extends {TreeElement} | 952 * @extends {TreeElement} |
953 * @param {!WebInspector.NavigatorView} navigatorView | 953 * @param {!WebInspector.NavigatorView} navigatorView |
954 * @param {!WebInspector.UISourceCode} uiSourceCode | 954 * @param {!WebInspector.UISourceCode} uiSourceCode |
955 * @param {string} title | 955 * @param {string} title |
956 */ | 956 */ |
957 WebInspector.NavigatorSourceTreeElement = function(navigatorView, uiSourceCode,
title) | 957 WebInspector.NavigatorSourceTreeElement = function(navigatorView, uiSourceCode,
title) |
958 { | 958 { |
959 TreeElement.call(this, "", false); | 959 TreeElement.call(this, "", false); |
960 this._nodeType = WebInspector.NavigatorView.Types.File; | 960 this._nodeType = WebInspector.NavigatorView.Types.File; |
961 this.title = title; | 961 this.title = title; |
962 this.listItemElement.classList.add("navigator-" + uiSourceCode.contentType()
.name() + "-tree-item", "navigator-file-tree-item"); | 962 this.listItemElement.classList.add("navigator-" + uiSourceCode.contentType()
.name() + "-tree-item", "navigator-file-tree-item"); |
963 this.tooltip = uiSourceCode.url(); | 963 this.tooltip = uiSourceCode.url(); |
964 this.createIcon(); | 964 this.createIcon(); |
965 | 965 |
966 this._navigatorView = navigatorView; | 966 this._navigatorView = navigatorView; |
967 this._uiSourceCode = uiSourceCode; | 967 this._uiSourceCode = uiSourceCode; |
968 } | 968 }; |
969 | 969 |
970 WebInspector.NavigatorSourceTreeElement.prototype = { | 970 WebInspector.NavigatorSourceTreeElement.prototype = { |
971 /** | 971 /** |
972 * @return {!WebInspector.UISourceCode} | 972 * @return {!WebInspector.UISourceCode} |
973 */ | 973 */ |
974 get uiSourceCode() | 974 get uiSourceCode() |
975 { | 975 { |
976 return this._uiSourceCode; | 976 return this._uiSourceCode; |
977 }, | 977 }, |
978 | 978 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1084 /** | 1084 /** |
1085 * @param {!Event} event | 1085 * @param {!Event} event |
1086 */ | 1086 */ |
1087 _handleContextMenuEvent: function(event) | 1087 _handleContextMenuEvent: function(event) |
1088 { | 1088 { |
1089 this.select(); | 1089 this.select(); |
1090 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); | 1090 this._navigatorView.handleFileContextMenu(event, this._uiSourceCode); |
1091 }, | 1091 }, |
1092 | 1092 |
1093 __proto__: TreeElement.prototype | 1093 __proto__: TreeElement.prototype |
1094 } | 1094 }; |
1095 | 1095 |
1096 /** | 1096 /** |
1097 * @constructor | 1097 * @constructor |
1098 * @param {string} id | 1098 * @param {string} id |
1099 * @param {string} type | 1099 * @param {string} type |
1100 */ | 1100 */ |
1101 WebInspector.NavigatorTreeNode = function(id, type) | 1101 WebInspector.NavigatorTreeNode = function(id, type) |
1102 { | 1102 { |
1103 this.id = id; | 1103 this.id = id; |
1104 this._type = type; | 1104 this._type = type; |
1105 /** @type {!Map.<string, !WebInspector.NavigatorTreeNode>} */ | 1105 /** @type {!Map.<string, !WebInspector.NavigatorTreeNode>} */ |
1106 this._children = new Map(); | 1106 this._children = new Map(); |
1107 } | 1107 }; |
1108 | 1108 |
1109 WebInspector.NavigatorTreeNode.prototype = { | 1109 WebInspector.NavigatorTreeNode.prototype = { |
1110 /** | 1110 /** |
1111 * @return {!TreeElement} | 1111 * @return {!TreeElement} |
1112 */ | 1112 */ |
1113 treeNode: function() { throw "Not implemented"; }, | 1113 treeNode: function() { throw "Not implemented"; }, |
1114 | 1114 |
1115 dispose: function() { }, | 1115 dispose: function() { }, |
1116 | 1116 |
1117 /** | 1117 /** |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1228 this.willRemoveChild(node); | 1228 this.willRemoveChild(node); |
1229 this._children.remove(node.id); | 1229 this._children.remove(node.id); |
1230 delete node.parent; | 1230 delete node.parent; |
1231 node.dispose(); | 1231 node.dispose(); |
1232 }, | 1232 }, |
1233 | 1233 |
1234 reset: function() | 1234 reset: function() |
1235 { | 1235 { |
1236 this._children.clear(); | 1236 this._children.clear(); |
1237 } | 1237 } |
1238 } | 1238 }; |
1239 | 1239 |
1240 /** | 1240 /** |
1241 * @constructor | 1241 * @constructor |
1242 * @extends {WebInspector.NavigatorTreeNode} | 1242 * @extends {WebInspector.NavigatorTreeNode} |
1243 * @param {!WebInspector.NavigatorView} navigatorView | 1243 * @param {!WebInspector.NavigatorView} navigatorView |
1244 */ | 1244 */ |
1245 WebInspector.NavigatorRootTreeNode = function(navigatorView) | 1245 WebInspector.NavigatorRootTreeNode = function(navigatorView) |
1246 { | 1246 { |
1247 WebInspector.NavigatorTreeNode.call(this, "", WebInspector.NavigatorView.Typ
es.Root); | 1247 WebInspector.NavigatorTreeNode.call(this, "", WebInspector.NavigatorView.Typ
es.Root); |
1248 this._navigatorView = navigatorView; | 1248 this._navigatorView = navigatorView; |
1249 } | 1249 }; |
1250 | 1250 |
1251 WebInspector.NavigatorRootTreeNode.prototype = { | 1251 WebInspector.NavigatorRootTreeNode.prototype = { |
1252 /** | 1252 /** |
1253 * @override | 1253 * @override |
1254 * @return {boolean} | 1254 * @return {boolean} |
1255 */ | 1255 */ |
1256 isRoot: function() | 1256 isRoot: function() |
1257 { | 1257 { |
1258 return true; | 1258 return true; |
1259 }, | 1259 }, |
1260 | 1260 |
1261 /** | 1261 /** |
1262 * @override | 1262 * @override |
1263 * @return {!TreeElement} | 1263 * @return {!TreeElement} |
1264 */ | 1264 */ |
1265 treeNode: function() | 1265 treeNode: function() |
1266 { | 1266 { |
1267 return this._navigatorView._scriptsTree.rootElement(); | 1267 return this._navigatorView._scriptsTree.rootElement(); |
1268 }, | 1268 }, |
1269 | 1269 |
1270 __proto__: WebInspector.NavigatorTreeNode.prototype | 1270 __proto__: WebInspector.NavigatorTreeNode.prototype |
1271 } | 1271 }; |
1272 | 1272 |
1273 /** | 1273 /** |
1274 * @constructor | 1274 * @constructor |
1275 * @extends {WebInspector.NavigatorTreeNode} | 1275 * @extends {WebInspector.NavigatorTreeNode} |
1276 * @param {!WebInspector.NavigatorView} navigatorView | 1276 * @param {!WebInspector.NavigatorView} navigatorView |
1277 * @param {!WebInspector.UISourceCode} uiSourceCode | 1277 * @param {!WebInspector.UISourceCode} uiSourceCode |
1278 */ | 1278 */ |
1279 WebInspector.NavigatorUISourceCodeTreeNode = function(navigatorView, uiSourceCod
e) | 1279 WebInspector.NavigatorUISourceCodeTreeNode = function(navigatorView, uiSourceCod
e) |
1280 { | 1280 { |
1281 WebInspector.NavigatorTreeNode.call(this, uiSourceCode.project().id() + ":"
+ uiSourceCode.url(), WebInspector.NavigatorView.Types.File); | 1281 WebInspector.NavigatorTreeNode.call(this, uiSourceCode.project().id() + ":"
+ uiSourceCode.url(), WebInspector.NavigatorView.Types.File); |
1282 this._navigatorView = navigatorView; | 1282 this._navigatorView = navigatorView; |
1283 this._uiSourceCode = uiSourceCode; | 1283 this._uiSourceCode = uiSourceCode; |
1284 this._treeElement = null; | 1284 this._treeElement = null; |
1285 this._eventListeners = []; | 1285 this._eventListeners = []; |
1286 } | 1286 }; |
1287 | 1287 |
1288 WebInspector.NavigatorUISourceCodeTreeNode.prototype = { | 1288 WebInspector.NavigatorUISourceCodeTreeNode.prototype = { |
1289 /** | 1289 /** |
1290 * @return {!WebInspector.UISourceCode} | 1290 * @return {!WebInspector.UISourceCode} |
1291 */ | 1291 */ |
1292 uiSourceCode: function() | 1292 uiSourceCode: function() |
1293 { | 1293 { |
1294 return this._uiSourceCode; | 1294 return this._uiSourceCode; |
1295 }, | 1295 }, |
1296 | 1296 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 this._treeElement.treeOutline.focus(); | 1434 this._treeElement.treeOutline.focus(); |
1435 if (callback) | 1435 if (callback) |
1436 callback(committed); | 1436 callback(committed); |
1437 } | 1437 } |
1438 | 1438 |
1439 this.updateTitle(true); | 1439 this.updateTitle(true); |
1440 this._treeElement.startEditingTitle(new WebInspector.InplaceEditor.Confi
g(commitHandler.bind(this), afterEditing.bind(this, false))); | 1440 this._treeElement.startEditingTitle(new WebInspector.InplaceEditor.Confi
g(commitHandler.bind(this), afterEditing.bind(this, false))); |
1441 }, | 1441 }, |
1442 | 1442 |
1443 __proto__: WebInspector.NavigatorTreeNode.prototype | 1443 __proto__: WebInspector.NavigatorTreeNode.prototype |
1444 } | 1444 }; |
1445 | 1445 |
1446 /** | 1446 /** |
1447 * @constructor | 1447 * @constructor |
1448 * @extends {WebInspector.NavigatorTreeNode} | 1448 * @extends {WebInspector.NavigatorTreeNode} |
1449 * @param {!WebInspector.NavigatorView} navigatorView | 1449 * @param {!WebInspector.NavigatorView} navigatorView |
1450 * @param {?WebInspector.Project} project | 1450 * @param {?WebInspector.Project} project |
1451 * @param {string} id | 1451 * @param {string} id |
1452 * @param {string} type | 1452 * @param {string} type |
1453 * @param {string} folderPath | 1453 * @param {string} folderPath |
1454 * @param {string} title | 1454 * @param {string} title |
1455 */ | 1455 */ |
1456 WebInspector.NavigatorFolderTreeNode = function(navigatorView, project, id, type
, folderPath, title) | 1456 WebInspector.NavigatorFolderTreeNode = function(navigatorView, project, id, type
, folderPath, title) |
1457 { | 1457 { |
1458 WebInspector.NavigatorTreeNode.call(this, id, type); | 1458 WebInspector.NavigatorTreeNode.call(this, id, type); |
1459 this._navigatorView = navigatorView; | 1459 this._navigatorView = navigatorView; |
1460 this._project = project; | 1460 this._project = project; |
1461 this._folderPath = folderPath; | 1461 this._folderPath = folderPath; |
1462 this._title = title; | 1462 this._title = title; |
1463 } | 1463 }; |
1464 | 1464 |
1465 WebInspector.NavigatorFolderTreeNode.prototype = { | 1465 WebInspector.NavigatorFolderTreeNode.prototype = { |
1466 /** | 1466 /** |
1467 * @override | 1467 * @override |
1468 * @return {!TreeElement} | 1468 * @return {!TreeElement} |
1469 */ | 1469 */ |
1470 treeNode: function() | 1470 treeNode: function() |
1471 { | 1471 { |
1472 if (this._treeElement) | 1472 if (this._treeElement) |
1473 return this._treeElement; | 1473 return this._treeElement; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1598 * @param {!WebInspector.NavigatorTreeNode} node | 1598 * @param {!WebInspector.NavigatorTreeNode} node |
1599 */ | 1599 */ |
1600 willRemoveChild: function(node) | 1600 willRemoveChild: function(node) |
1601 { | 1601 { |
1602 if (node._isMerged || !this.isPopulated()) | 1602 if (node._isMerged || !this.isPopulated()) |
1603 return; | 1603 return; |
1604 this._treeElement.removeChild(node._treeElement); | 1604 this._treeElement.removeChild(node._treeElement); |
1605 }, | 1605 }, |
1606 | 1606 |
1607 __proto__: WebInspector.NavigatorTreeNode.prototype | 1607 __proto__: WebInspector.NavigatorTreeNode.prototype |
1608 } | 1608 }; |
1609 | 1609 |
1610 /** | 1610 /** |
1611 * @constructor | 1611 * @constructor |
1612 * @extends {WebInspector.NavigatorTreeNode} | 1612 * @extends {WebInspector.NavigatorTreeNode} |
1613 * @param {!WebInspector.NavigatorView} navigatorView | 1613 * @param {!WebInspector.NavigatorView} navigatorView |
1614 * @param {!WebInspector.Project} project | 1614 * @param {!WebInspector.Project} project |
1615 * @param {string} id | 1615 * @param {string} id |
1616 * @param {string} type | 1616 * @param {string} type |
1617 * @param {string} title | 1617 * @param {string} title |
1618 */ | 1618 */ |
1619 WebInspector.NavigatorGroupTreeNode = function(navigatorView, project, id, type,
title) | 1619 WebInspector.NavigatorGroupTreeNode = function(navigatorView, project, id, type,
title) |
1620 { | 1620 { |
1621 WebInspector.NavigatorTreeNode.call(this, id, type); | 1621 WebInspector.NavigatorTreeNode.call(this, id, type); |
1622 this._project = project; | 1622 this._project = project; |
1623 this._navigatorView = navigatorView; | 1623 this._navigatorView = navigatorView; |
1624 this._title = title; | 1624 this._title = title; |
1625 this.populate(); | 1625 this.populate(); |
1626 } | 1626 }; |
1627 | 1627 |
1628 WebInspector.NavigatorGroupTreeNode.prototype = { | 1628 WebInspector.NavigatorGroupTreeNode.prototype = { |
1629 /** | 1629 /** |
1630 * @param {function(boolean)} hoverCallback | 1630 * @param {function(boolean)} hoverCallback |
1631 */ | 1631 */ |
1632 setHoverCallback: function(hoverCallback) | 1632 setHoverCallback: function(hoverCallback) |
1633 { | 1633 { |
1634 this._hoverCallback = hoverCallback; | 1634 this._hoverCallback = hoverCallback; |
1635 }, | 1635 }, |
1636 | 1636 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 * @override | 1680 * @override |
1681 */ | 1681 */ |
1682 setTitle: function(title) | 1682 setTitle: function(title) |
1683 { | 1683 { |
1684 this._title = title; | 1684 this._title = title; |
1685 if (this._treeElement) | 1685 if (this._treeElement) |
1686 this._treeElement.title = this._title; | 1686 this._treeElement.title = this._title; |
1687 }, | 1687 }, |
1688 | 1688 |
1689 __proto__: WebInspector.NavigatorTreeNode.prototype | 1689 __proto__: WebInspector.NavigatorTreeNode.prototype |
1690 } | 1690 }; |
OLD | NEW |