| 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 function_ref_element; | 5 library function_ref_element; |
| 6 | 6 |
| 7 import 'dart:html'; | 7 import 'dart:html'; |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'package:observatory/models.dart' as M | 9 import 'package:observatory/models.dart' as M |
| 10 show IsolateRef, FunctionRef, isSyntheticFunction, ClassRef, ObjectRef, | 10 show |
| 11 getFunctionFullName; | 11 IsolateRef, |
| 12 FunctionRef, |
| 13 isSyntheticFunction, |
| 14 ClassRef, |
| 15 ObjectRef, |
| 16 getFunctionFullName; |
| 12 import 'package:observatory/src/elements/class_ref.dart'; | 17 import 'package:observatory/src/elements/class_ref.dart'; |
| 13 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 18 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
| 14 import 'package:observatory/src/elements/helpers/tag.dart'; | 19 import 'package:observatory/src/elements/helpers/tag.dart'; |
| 15 import 'package:observatory/src/elements/helpers/uris.dart'; | 20 import 'package:observatory/src/elements/helpers/uris.dart'; |
| 16 | 21 |
| 17 class FunctionRefElement extends HtmlElement implements Renderable { | 22 class FunctionRefElement extends HtmlElement implements Renderable { |
| 18 static const tag = const Tag<FunctionRefElement>('function-ref'); | 23 static const tag = const Tag<FunctionRefElement>('function-ref'); |
| 19 | 24 |
| 20 RenderingScheduler<FunctionRefElement> _r; | 25 RenderingScheduler<FunctionRefElement> _r; |
| 21 | 26 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 @override | 58 @override |
| 54 void detached() { | 59 void detached() { |
| 55 super.detached(); | 60 super.detached(); |
| 56 children = []; | 61 children = []; |
| 57 title = ''; | 62 title = ''; |
| 58 _r.disable(notify: true); | 63 _r.disable(notify: true); |
| 59 } | 64 } |
| 60 | 65 |
| 61 void render() { | 66 void render() { |
| 62 var content = <Element>[ | 67 var content = <Element>[ |
| 63 new AnchorElement(href: M.isSyntheticFunction(_function.kind) ? null | 68 new AnchorElement( |
| 64 : Uris.inspect(_isolate, object: _function)) | 69 href: M.isSyntheticFunction(_function.kind) |
| 70 ? null |
| 71 : Uris.inspect(_isolate, object: _function)) |
| 65 ..text = _function.name | 72 ..text = _function.name |
| 66 ]; | 73 ]; |
| 67 if (qualified) { | 74 if (qualified) { |
| 68 M.ObjectRef owner = _function.dartOwner; | 75 M.ObjectRef owner = _function.dartOwner; |
| 69 while (owner is M.FunctionRef) { | 76 while (owner is M.FunctionRef) { |
| 70 M.FunctionRef function = (owner as M.FunctionRef); | 77 M.FunctionRef function = (owner as M.FunctionRef); |
| 71 content.addAll([ | 78 content.addAll([ |
| 72 new SpanElement()..text = '.', | 79 new SpanElement()..text = '.', |
| 73 new AnchorElement(href: M.isSyntheticFunction(function.kind) ? null | 80 new AnchorElement( |
| 74 : Uris.inspect(_isolate, object: function)) | 81 href: M.isSyntheticFunction(function.kind) |
| 82 ? null |
| 83 : Uris.inspect(_isolate, object: function)) |
| 75 ..text = function.name | 84 ..text = function.name |
| 76 ]); | 85 ]); |
| 77 owner = function.dartOwner; | 86 owner = function.dartOwner; |
| 78 } | 87 } |
| 79 if (owner is M.ClassRef) { | 88 if (owner is M.ClassRef) { |
| 80 content.addAll([ | 89 content.addAll([ |
| 81 new SpanElement()..text = '.', | 90 new SpanElement()..text = '.', |
| 82 new ClassRefElement(_isolate, owner, queue: _r.queue) | 91 new ClassRefElement(_isolate, owner, queue: _r.queue) |
| 83 ]); | 92 ]); |
| 84 } | 93 } |
| 85 } | 94 } |
| 86 children = content.reversed.toList(growable: false); | 95 children = content.reversed.toList(growable: false); |
| 87 title = M.getFunctionFullName(_function); | 96 title = M.getFunctionFullName(_function); |
| 88 } | 97 } |
| 89 } | 98 } |
| OLD | NEW |