| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library service_object_view_element; | 5 library service_object_view_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'package:logging/logging.dart'; | 8 import 'package:logging/logging.dart'; |
| 9 import 'package:observatory/service.dart'; | 9 import 'package:observatory/service.dart'; |
| 10 import 'package:observatory/tracer.dart'; |
| 10 import 'package:observatory/elements.dart'; | 11 import 'package:observatory/elements.dart'; |
| 11 import 'package:polymer/polymer.dart'; | 12 import 'package:polymer/polymer.dart'; |
| 12 import 'observatory_element.dart'; | 13 import 'observatory_element.dart'; |
| 13 | 14 |
| 14 @CustomTag('service-view') | 15 @CustomTag('service-view') |
| 15 class ServiceObjectViewElement extends ObservatoryElement { | 16 class ServiceObjectViewElement extends ObservatoryElement { |
| 16 @published ServiceObject object; | 17 @published ServiceObject object; |
| 17 @published ObservableMap args; | 18 @published ObservableMap args; |
| 18 | 19 |
| 19 ServiceObjectViewElement.created() : super.created(); | 20 ServiceObjectViewElement.created() : super.created(); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 var type = object.serviceType; | 200 var type = object.serviceType; |
| 200 var element = _constructElementForObject(); | 201 var element = _constructElementForObject(); |
| 201 if (element == null) { | 202 if (element == null) { |
| 202 Logger.root.info('Unable to find a view element for \'${type}\''); | 203 Logger.root.info('Unable to find a view element for \'${type}\''); |
| 203 return; | 204 return; |
| 204 } | 205 } |
| 205 children.add(element); | 206 children.add(element); |
| 206 Logger.root.info('Viewing object of \'${type}\''); | 207 Logger.root.info('Viewing object of \'${type}\''); |
| 207 } | 208 } |
| 208 } | 209 } |
| 210 |
| 211 @CustomTag('trace-view') |
| 212 class TraceViewElement extends ObservatoryElement { |
| 213 @published Tracer tracer; |
| 214 TraceViewElement.created() : super.created(); |
| 215 } |
| 216 |
| 217 @CustomTag('map-viewer') |
| 218 class MapViewerElement extends ObservatoryElement { |
| 219 @published Map map; |
| 220 @published bool expand = false; |
| 221 MapViewerElement.created() : super.created(); |
| 222 |
| 223 bool isMap(var m) { |
| 224 return m is Map; |
| 225 } |
| 226 |
| 227 bool isList(var m) { |
| 228 return m is List; |
| 229 } |
| 230 |
| 231 dynamic expander() { |
| 232 return expandEvent; |
| 233 } |
| 234 |
| 235 void expandEvent(bool exp, var done) { |
| 236 expand = exp; |
| 237 done(); |
| 238 } |
| 239 } |
| 240 |
| 241 @CustomTag('list-viewer') |
| 242 class ListViewerElement extends ObservatoryElement { |
| 243 @published List list; |
| 244 @published bool expand = false; |
| 245 ListViewerElement.created() : super.created(); |
| 246 |
| 247 bool isMap(var m) { |
| 248 return m is Map; |
| 249 } |
| 250 |
| 251 bool isList(var m) { |
| 252 return m is List; |
| 253 } |
| 254 |
| 255 dynamic expander() { |
| 256 return expandEvent; |
| 257 } |
| 258 |
| 259 void expandEvent(bool exp, var done) { |
| 260 expand = exp; |
| 261 done(); |
| 262 } |
| 263 } |
| OLD | NEW |