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:async'; | 5 import 'dart:async'; |
6 import 'dart:html'; | 6 import 'dart:html'; |
7 import 'package:observatory/models.dart' as M; | 7 import 'package:observatory/models.dart' as M; |
8 import 'package:observatory/src/elements/context_ref.dart'; | 8 import 'package:observatory/src/elements/context_ref.dart'; |
9 import 'package:observatory/src/elements/curly_block.dart'; | 9 import 'package:observatory/src/elements/curly_block.dart'; |
| 10 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
| 11 import 'package:observatory/src/elements/helpers/nav_menu.dart'; |
10 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 12 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
11 import 'package:observatory/src/elements/helpers/tag.dart'; | 13 import 'package:observatory/src/elements/helpers/tag.dart'; |
12 import 'package:observatory/src/elements/nav/bar.dart'; | |
13 import 'package:observatory/src/elements/nav/isolate_menu.dart'; | 14 import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
14 import 'package:observatory/src/elements/nav/menu.dart'; | |
15 import 'package:observatory/src/elements/nav/notify.dart'; | 15 import 'package:observatory/src/elements/nav/notify.dart'; |
16 import 'package:observatory/src/elements/nav/refresh.dart'; | 16 import 'package:observatory/src/elements/nav/refresh.dart'; |
17 import 'package:observatory/src/elements/nav/top_menu.dart'; | 17 import 'package:observatory/src/elements/nav/top_menu.dart'; |
18 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 18 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
19 import 'package:observatory/src/elements/object_common.dart'; | 19 import 'package:observatory/src/elements/object_common.dart'; |
20 import 'package:observatory/src/elements/view_footer.dart'; | 20 import 'package:observatory/src/elements/view_footer.dart'; |
21 | 21 |
22 class ObjectViewElement extends HtmlElement implements Renderable { | 22 class ObjectViewElement extends HtmlElement implements Renderable { |
23 static const tag = const Tag<ObjectViewElement>('object-view', | 23 static const tag = const Tag<ObjectViewElement>('object-view', |
24 dependencies: const [ | 24 dependencies: const [ |
25 ContextRefElement.tag, | 25 ContextRefElement.tag, |
26 CurlyBlockElement.tag, | 26 CurlyBlockElement.tag, |
27 NavBarElement.tag, | |
28 NavTopMenuElement.tag, | 27 NavTopMenuElement.tag, |
29 NavVMMenuElement.tag, | 28 NavVMMenuElement.tag, |
30 NavIsolateMenuElement.tag, | 29 NavIsolateMenuElement.tag, |
31 NavMenuElement.tag, | |
32 NavRefreshElement.tag, | 30 NavRefreshElement.tag, |
33 NavNotifyElement.tag, | 31 NavNotifyElement.tag, |
34 ObjectCommonElement.tag, | 32 ObjectCommonElement.tag, |
35 ViewFooterElement.tag | 33 ViewFooterElement.tag |
36 ]); | 34 ]); |
37 | 35 |
38 RenderingScheduler<ObjectViewElement> _r; | 36 RenderingScheduler<ObjectViewElement> _r; |
39 | 37 |
40 Stream<RenderedEvent<ObjectViewElement>> get onRendered => _r.onRendered; | 38 Stream<RenderedEvent<ObjectViewElement>> get onRendered => _r.onRendered; |
41 | 39 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 102 |
105 @override | 103 @override |
106 detached() { | 104 detached() { |
107 super.detached(); | 105 super.detached(); |
108 _r.disable(notify: true); | 106 _r.disable(notify: true); |
109 children = []; | 107 children = []; |
110 } | 108 } |
111 | 109 |
112 void render() { | 110 void render() { |
113 children = [ | 111 children = [ |
114 new NavBarElement(queue: _r.queue) | 112 navBar([ |
115 ..children = [ | 113 new NavTopMenuElement(queue: _r.queue), |
116 new NavTopMenuElement(queue: _r.queue), | 114 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
117 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 115 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), |
118 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), | 116 navMenu('object'), |
119 new NavMenuElement('object', last: true, queue: _r.queue), | 117 new NavRefreshElement(queue: _r.queue) |
120 new NavRefreshElement(queue: _r.queue) | 118 ..onRefresh.listen((e) async { |
121 ..onRefresh.listen((e) async { | 119 e.element.disabled = true; |
122 e.element.disabled = true; | 120 _object = await _objects.get(_isolate, _object.id); |
123 _object = await _objects.get(_isolate, _object.id); | 121 _r.dirty(); |
124 _r.dirty(); | 122 }), |
125 }), | 123 new NavNotifyElement(_notifications, queue: _r.queue) |
126 new NavNotifyElement(_notifications, queue: _r.queue) | 124 ]), |
127 ], | |
128 new DivElement()..classes = ['content-centered-big'] | 125 new DivElement()..classes = ['content-centered-big'] |
129 ..children = [ | 126 ..children = [ |
130 new HeadingElement.h2()..text = 'Object', | 127 new HeadingElement.h2()..text = 'Object', |
131 new HRElement(), | 128 new HRElement(), |
132 new ObjectCommonElement(_isolate, _object, _retainedSizes, | 129 new ObjectCommonElement(_isolate, _object, _retainedSizes, |
133 _reachableSizes, _references, _retainingPaths, | 130 _reachableSizes, _references, _retainingPaths, |
134 _instances, queue: _r.queue), | 131 _instances, queue: _r.queue), |
135 new HRElement(), | 132 new HRElement(), |
136 new ViewFooterElement(queue: _r.queue) | 133 new ViewFooterElement(queue: _r.queue) |
137 ] | 134 ] |
138 ]; | 135 ]; |
139 } | 136 } |
140 } | 137 } |
OLD | NEW |