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 import 'dart:html'; | 5 import 'dart:html'; |
6 import 'dart:async'; | 6 import 'dart:async'; |
7 import 'package:observatory/models.dart' as M | 7 import 'package:observatory/models.dart' as M show IsolateRef, UnknownObjectRef; |
8 show IsolateRef, UnknownObjectRef; | |
9 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 8 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
10 import 'package:observatory/src/elements/helpers/tag.dart'; | 9 import 'package:observatory/src/elements/helpers/tag.dart'; |
11 import 'package:observatory/src/elements/helpers/uris.dart'; | 10 import 'package:observatory/src/elements/helpers/uris.dart'; |
12 | 11 |
13 class UnknownObjectRefElement extends HtmlElement implements Renderable { | 12 class UnknownObjectRefElement extends HtmlElement implements Renderable { |
14 static const tag = const Tag<UnknownObjectRefElement>('unknown-ref'); | 13 static const tag = const Tag<UnknownObjectRefElement>('unknown-ref'); |
15 | 14 |
16 RenderingScheduler<UnknownObjectRefElement> _r; | 15 RenderingScheduler<UnknownObjectRefElement> _r; |
17 | 16 |
18 Stream<RenderedEvent<UnknownObjectRefElement>> get onRendered => | 17 Stream<RenderedEvent<UnknownObjectRefElement>> get onRendered => |
19 _r.onRendered; | 18 _r.onRendered; |
20 | 19 |
21 M.IsolateRef _isolate; | 20 M.IsolateRef _isolate; |
22 M.UnknownObjectRef _obj; | 21 M.UnknownObjectRef _obj; |
23 | 22 |
24 M.IsolateRef get isolate => _isolate; | 23 M.IsolateRef get isolate => _isolate; |
25 M.UnknownObjectRef get obj => _obj; | 24 M.UnknownObjectRef get obj => _obj; |
26 | 25 |
27 factory UnknownObjectRefElement(M.IsolateRef isolate, | 26 factory UnknownObjectRefElement(M.IsolateRef isolate, M.UnknownObjectRef obj, |
28 M.UnknownObjectRef obj, {RenderingQueue queue}) { | 27 {RenderingQueue queue}) { |
29 assert(isolate != null); | 28 assert(isolate != null); |
30 assert(obj != null); | 29 assert(obj != null); |
31 UnknownObjectRefElement e = document.createElement(tag.name); | 30 UnknownObjectRefElement e = document.createElement(tag.name); |
32 e._r = new RenderingScheduler(e, queue: queue); | 31 e._r = new RenderingScheduler(e, queue: queue); |
33 e._isolate = isolate; | 32 e._isolate = isolate; |
34 e._obj = obj; | 33 e._obj = obj; |
35 return e; | 34 return e; |
36 } | 35 } |
37 | 36 |
38 UnknownObjectRefElement.created() : super.created(); | 37 UnknownObjectRefElement.created() : super.created(); |
(...skipping 11 matching lines...) Expand all Loading... |
50 children = []; | 49 children = []; |
51 } | 50 } |
52 | 51 |
53 void render() { | 52 void render() { |
54 children = [ | 53 children = [ |
55 new AnchorElement(href: Uris.inspect(_isolate, object: _obj)) | 54 new AnchorElement(href: Uris.inspect(_isolate, object: _obj)) |
56 ..text = _obj.vmType | 55 ..text = _obj.vmType |
57 ]; | 56 ]; |
58 } | 57 } |
59 } | 58 } |
OLD | NEW |