| 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_ref_element; | 5 library service_ref_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:polymer/polymer.dart'; | 9 import 'package:polymer/polymer.dart'; |
| 10 import 'observatory_element.dart'; | 10 import 'observatory_element.dart'; |
| 11 import 'package:observatory/service.dart'; | 11 import 'package:observatory/service.dart'; |
| 12 | 12 |
| 13 @CustomTag('service-ref') | 13 @CustomTag('service-ref') |
| 14 class ServiceRefElement extends ObservatoryElement { | 14 class ServiceRefElement extends ObservatoryElement { |
| 15 @published ServiceObject ref; | 15 @published ServiceObject ref; |
| 16 @published bool internal = false; | 16 @published bool internal = false; |
| 17 ServiceRefElement.created() : super.created(); | 17 ServiceRefElement.created() : super.created(); |
| 18 | 18 |
| 19 void refChanged(oldValue) { | 19 void refChanged(oldValue) { |
| 20 notifyPropertyChange(#url, "", url); | 20 notifyPropertyChange(#url, "", url); |
| 21 notifyPropertyChange(#name, [], name); | 21 notifyPropertyChange(#name, [], name); |
| 22 notifyPropertyChange(#nameIsEmpty, 0, 1); | 22 notifyPropertyChange(#nameIsEmpty, 0, 1); |
| 23 notifyPropertyChange(#hoverText, "", hoverText); | 23 notifyPropertyChange(#hoverText, "", hoverText); |
| 24 } | 24 } |
| 25 | 25 |
| 26 String get url { | 26 String get url { |
| 27 if (ref == null) { | 27 if (ref == null) { |
| 28 return 'NULL REF'; | 28 return 'NULL REF'; |
| 29 } | 29 } |
| 30 return gotoLink(ref.link); | 30 return gotoLink('/inspect', ref); |
| 31 } | 31 } |
| 32 | 32 |
| 33 String get serviceId { | 33 String get serviceId { |
| 34 if (ref == null) { | 34 if (ref == null) { |
| 35 return 'NULL REF'; | 35 return 'NULL REF'; |
| 36 } | 36 } |
| 37 return ref.id; | 37 return ref.id; |
| 38 } | 38 } |
| 39 | 39 |
| 40 String get hoverText { | 40 String get hoverText { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 131 } |
| 132 children.add(element); | 132 children.add(element); |
| 133 Logger.root.info('Viewing object of \'${type}\''); | 133 Logger.root.info('Viewing object of \'${type}\''); |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 | 136 |
| 137 @CustomTag('object-ref') | 137 @CustomTag('object-ref') |
| 138 class ObjectRefElement extends ServiceRefElement { | 138 class ObjectRefElement extends ServiceRefElement { |
| 139 ObjectRefElement.created() : super.created(); | 139 ObjectRefElement.created() : super.created(); |
| 140 } | 140 } |
| OLD | NEW |