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/any_ref.dart'; | 10 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| 11 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
| 12 import 'package:observatory/src/elements/helpers/nav_menu.dart'; |
11 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 13 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
12 import 'package:observatory/src/elements/helpers/tag.dart'; | 14 import 'package:observatory/src/elements/helpers/tag.dart'; |
13 import 'package:observatory/src/elements/nav/bar.dart'; | |
14 import 'package:observatory/src/elements/nav/class_menu.dart'; | 15 import 'package:observatory/src/elements/nav/class_menu.dart'; |
15 import 'package:observatory/src/elements/nav/isolate_menu.dart'; | 16 import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
16 import 'package:observatory/src/elements/nav/menu.dart'; | |
17 import 'package:observatory/src/elements/nav/notify.dart'; | 17 import 'package:observatory/src/elements/nav/notify.dart'; |
18 import 'package:observatory/src/elements/nav/refresh.dart'; | 18 import 'package:observatory/src/elements/nav/refresh.dart'; |
19 import 'package:observatory/src/elements/nav/top_menu.dart'; | 19 import 'package:observatory/src/elements/nav/top_menu.dart'; |
20 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 20 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
21 import 'package:observatory/src/elements/object_common.dart'; | 21 import 'package:observatory/src/elements/object_common.dart'; |
22 import 'package:observatory/src/elements/view_footer.dart'; | 22 import 'package:observatory/src/elements/view_footer.dart'; |
23 | 23 |
24 class ContextViewElement extends HtmlElement implements Renderable { | 24 class ContextViewElement extends HtmlElement implements Renderable { |
25 static const tag = const Tag<ContextViewElement>('context-view', | 25 static const tag = const Tag<ContextViewElement>('context-view', |
26 dependencies: const [ | 26 dependencies: const [ |
27 ContextRefElement.tag, | 27 ContextRefElement.tag, |
28 CurlyBlockElement.tag, | 28 CurlyBlockElement.tag, |
29 NavBarElement.tag, | |
30 NavClassMenuElement.tag, | 29 NavClassMenuElement.tag, |
31 NavTopMenuElement.tag, | 30 NavTopMenuElement.tag, |
32 NavVMMenuElement.tag, | 31 NavVMMenuElement.tag, |
33 NavIsolateMenuElement.tag, | 32 NavIsolateMenuElement.tag, |
34 NavMenuElement.tag, | |
35 NavRefreshElement.tag, | 33 NavRefreshElement.tag, |
36 NavNotifyElement.tag, | 34 NavNotifyElement.tag, |
37 ObjectCommonElement.tag, | 35 ObjectCommonElement.tag, |
38 ViewFooterElement.tag | 36 ViewFooterElement.tag |
39 ]); | 37 ]); |
40 | 38 |
41 RenderingScheduler<ContextViewElement> _r; | 39 RenderingScheduler<ContextViewElement> _r; |
42 | 40 |
43 Stream<RenderedEvent<ContextViewElement>> get onRendered => _r.onRendered; | 41 Stream<RenderedEvent<ContextViewElement>> get onRendered => _r.onRendered; |
44 | 42 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 | 105 |
108 @override | 106 @override |
109 detached() { | 107 detached() { |
110 super.detached(); | 108 super.detached(); |
111 _r.disable(notify: true); | 109 _r.disable(notify: true); |
112 children = []; | 110 children = []; |
113 } | 111 } |
114 | 112 |
115 void render() { | 113 void render() { |
116 var content = [ | 114 var content = [ |
117 new NavBarElement(queue: _r.queue) | 115 navBar([ |
118 ..children = [ | 116 new NavTopMenuElement(queue: _r.queue), |
119 new NavTopMenuElement(queue: _r.queue), | 117 new NavVMMenuElement(_vm, _events, queue: _r.queue), |
120 new NavVMMenuElement(_vm, _events, queue: _r.queue), | 118 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), |
121 new NavIsolateMenuElement(_isolate, _events, queue: _r.queue), | 119 new NavClassMenuElement(_isolate, _context.clazz, queue: _r.queue), |
122 new NavClassMenuElement(_isolate, _context.clazz, queue: _r.queue), | 120 navMenu('instance'), |
123 new NavMenuElement('instance', last: true, queue: _r.queue), | 121 new NavRefreshElement(queue: _r.queue) |
124 new NavRefreshElement(queue: _r.queue) | 122 ..onRefresh.listen((e) async { |
125 ..onRefresh.listen((e) async { | 123 e.element.disabled = true; |
126 e.element.disabled = true; | 124 _context = await _contexts.get(_isolate, _context.id); |
127 _context = await _contexts.get(_isolate, _context.id); | 125 _r.dirty(); |
128 _r.dirty(); | 126 }), |
129 }), | 127 new NavNotifyElement(_notifications, queue: _r.queue) |
130 new NavNotifyElement(_notifications, queue: _r.queue) | 128 ]), |
131 ], | |
132 new DivElement()..classes = ['content-centered-big'] | 129 new DivElement()..classes = ['content-centered-big'] |
133 ..children = [ | 130 ..children = [ |
134 new HeadingElement.h2()..text = 'Context', | 131 new HeadingElement.h2()..text = 'Context', |
135 new HRElement(), | 132 new HRElement(), |
136 new ObjectCommonElement(_isolate, _context, _retainedSizes, | 133 new ObjectCommonElement(_isolate, _context, _retainedSizes, |
137 _reachableSizes, _references, _retainingPaths, | 134 _reachableSizes, _references, _retainingPaths, |
138 _instances, queue: _r.queue) | 135 _instances, queue: _r.queue) |
139 ] | 136 ] |
140 ]; | 137 ]; |
141 if (_context.parentContext != null) { | 138 if (_context.parentContext != null) { |
(...skipping 19 matching lines...) Expand all Loading... |
161 } | 158 } |
162 content.add(new HRElement()); | 159 content.add(new HRElement()); |
163 if (_context.variables.isNotEmpty) { | 160 if (_context.variables.isNotEmpty) { |
164 int index = 0; | 161 int index = 0; |
165 content.addAll([ | 162 content.addAll([ |
166 new DivElement()..classes = ['content-centered-big'] | 163 new DivElement()..classes = ['content-centered-big'] |
167 ..children = [ | 164 ..children = [ |
168 new SpanElement()..text = 'Variables ', | 165 new SpanElement()..text = 'Variables ', |
169 new CurlyBlockElement(expanded: _context.variables.length > 8, | 166 new CurlyBlockElement(expanded: _context.variables.length > 8, |
170 queue: _r.queue) | 167 queue: _r.queue) |
171 ..children = [ | 168 ..content = [ |
172 new DivElement()..classes = ['memberList'] | 169 new DivElement()..classes = ['memberList'] |
173 ..children = _context.variables.map((variable) | 170 ..children = _context.variables.map((variable) |
174 => new DivElement()..classes = ['memberItem'] | 171 => new DivElement()..classes = ['memberItem'] |
175 ..children = [ | 172 ..children = [ |
176 new DivElement()..classes = ['memberName'] | 173 new DivElement()..classes = ['memberName'] |
177 ..text = '[ ${++index} ]', | 174 ..text = '[ ${++index} ]', |
178 new DivElement()..classes = ['memberName'] | 175 new DivElement()..classes = ['memberName'] |
179 ..children = [ | 176 ..children = [ |
180 anyRef(_isolate, variable.value, _instances, | 177 anyRef(_isolate, variable.value, _instances, |
181 queue: _r.queue) | 178 queue: _r.queue) |
182 ] | 179 ] |
183 ]).toList() | 180 ]).toList() |
184 ] | 181 ] |
185 ] | 182 ] |
186 ]); | 183 ]); |
187 } | 184 } |
188 content.add(new DivElement()..classes = ['content-centered-big'] | 185 content.add(new DivElement()..classes = ['content-centered-big'] |
189 ..children = [new ViewFooterElement(queue: _r.queue)]); | 186 ..children = [new ViewFooterElement(queue: _r.queue)]); |
190 children = content; | 187 children = content; |
191 } | 188 } |
192 } | 189 } |
OLD | NEW |