| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 library service_ref_element; | |
| 6 | |
| 7 import 'package:polymer/polymer.dart'; | |
| 8 import 'observatory_element.dart'; | |
| 9 import 'package:observatory/service.dart'; | |
| 10 | |
| 11 @CustomTag('service-ref') | |
| 12 class ServiceRefElement extends ObservatoryElement { | |
| 13 @published ServiceObject ref; | |
| 14 @published bool internal = false; | |
| 15 ServiceRefElement.created() : super.created(); | |
| 16 | |
| 17 void refChanged(oldValue) { | |
| 18 notifyPropertyChange(#url, "", url); | |
| 19 notifyPropertyChange(#name, [], name); | |
| 20 notifyPropertyChange(#nameIsEmpty, 0, 1); | |
| 21 notifyPropertyChange(#hoverText, "", hoverText); | |
| 22 } | |
| 23 | |
| 24 String get url { | |
| 25 if (ref == null) { | |
| 26 return 'NULL REF'; | |
| 27 } | |
| 28 return gotoLink(ref.link); | |
| 29 } | |
| 30 | |
| 31 String get serviceId { | |
| 32 if (ref == null) { | |
| 33 return 'NULL REF'; | |
| 34 } | |
| 35 return ref.id; | |
| 36 } | |
| 37 | |
| 38 String get hoverText { | |
| 39 if (ref == null) { | |
| 40 return 'NULL REF'; | |
| 41 } | |
| 42 return ref.vmName; | |
| 43 } | |
| 44 | |
| 45 String get name { | |
| 46 if (ref == null) { | |
| 47 return 'NULL REF'; | |
| 48 } | |
| 49 return ref.name; | |
| 50 } | |
| 51 | |
| 52 // Workaround isEmpty not being useable due to missing @MirrorsUsed. | |
| 53 bool get nameIsEmpty { | |
| 54 return name.isEmpty; | |
| 55 } | |
| 56 } | |
| OLD | NEW |