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_view_element; | 5 library function_view_element; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:html'; | 8 import 'dart:html'; |
9 import 'package:observatory/models.dart' as M; | 9 import 'package:observatory/models.dart' as M; |
10 import 'package:observatory/src/elements/class_ref.dart'; | 10 import 'package:observatory/src/elements/class_ref.dart'; |
11 import 'package:observatory/src/elements/code_ref.dart'; | 11 import 'package:observatory/src/elements/code_ref.dart'; |
12 import 'package:observatory/src/elements/curly_block.dart'; | 12 import 'package:observatory/src/elements/curly_block.dart'; |
13 import 'package:observatory/src/elements/field_ref.dart'; | 13 import 'package:observatory/src/elements/field_ref.dart'; |
14 import 'package:observatory/src/elements/instance_ref.dart'; | 14 import 'package:observatory/src/elements/instance_ref.dart'; |
15 import 'package:observatory/src/elements/helpers/any_ref.dart'; | 15 import 'package:observatory/src/elements/helpers/any_ref.dart'; |
| 16 import 'package:observatory/src/elements/helpers/nav_bar.dart'; |
| 17 import 'package:observatory/src/elements/helpers/nav_menu.dart'; |
16 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; | 18 import 'package:observatory/src/elements/helpers/rendering_scheduler.dart'; |
17 import 'package:observatory/src/elements/helpers/tag.dart'; | 19 import 'package:observatory/src/elements/helpers/tag.dart'; |
18 import 'package:observatory/src/elements/nav/bar.dart'; | |
19 import 'package:observatory/src/elements/nav/class_menu.dart'; | 20 import 'package:observatory/src/elements/nav/class_menu.dart'; |
20 import 'package:observatory/src/elements/nav/isolate_menu.dart'; | 21 import 'package:observatory/src/elements/nav/isolate_menu.dart'; |
21 import 'package:observatory/src/elements/nav/library_menu.dart'; | 22 import 'package:observatory/src/elements/nav/library_menu.dart'; |
22 import 'package:observatory/src/elements/nav/menu.dart'; | |
23 import 'package:observatory/src/elements/nav/notify.dart'; | 23 import 'package:observatory/src/elements/nav/notify.dart'; |
24 import 'package:observatory/src/elements/nav/refresh.dart'; | 24 import 'package:observatory/src/elements/nav/refresh.dart'; |
25 import 'package:observatory/src/elements/nav/top_menu.dart'; | 25 import 'package:observatory/src/elements/nav/top_menu.dart'; |
26 import 'package:observatory/src/elements/nav/vm_menu.dart'; | 26 import 'package:observatory/src/elements/nav/vm_menu.dart'; |
27 import 'package:observatory/src/elements/object_common.dart'; | 27 import 'package:observatory/src/elements/object_common.dart'; |
28 import 'package:observatory/src/elements/source_inset.dart'; | 28 import 'package:observatory/src/elements/source_inset.dart'; |
29 import 'package:observatory/src/elements/source_link.dart'; | 29 import 'package:observatory/src/elements/source_link.dart'; |
30 import 'package:observatory/src/elements/view_footer.dart'; | 30 import 'package:observatory/src/elements/view_footer.dart'; |
31 | 31 |
32 class FunctionViewElement extends HtmlElement implements Renderable { | 32 class FunctionViewElement extends HtmlElement implements Renderable { |
33 static const tag = const Tag<FunctionViewElement>('function-view', | 33 static const tag = const Tag<FunctionViewElement>('function-view', |
34 dependencies: const [ | 34 dependencies: const [ |
35 ClassRefElement.tag, | 35 ClassRefElement.tag, |
36 CodeRefElement.tag, | 36 CodeRefElement.tag, |
37 CurlyBlockElement.tag, | 37 CurlyBlockElement.tag, |
38 FieldRefElement.tag, | 38 FieldRefElement.tag, |
39 InstanceRefElement.tag, | 39 InstanceRefElement.tag, |
40 NavBarElement.tag, | |
41 NavClassMenuElement.tag, | 40 NavClassMenuElement.tag, |
42 NavLibraryMenuElement.tag, | 41 NavLibraryMenuElement.tag, |
43 NavTopMenuElement.tag, | 42 NavTopMenuElement.tag, |
44 NavVMMenuElement.tag, | 43 NavVMMenuElement.tag, |
45 NavIsolateMenuElement.tag, | 44 NavIsolateMenuElement.tag, |
46 NavMenuElement.tag, | |
47 NavRefreshElement.tag, | 45 NavRefreshElement.tag, |
48 NavNotifyElement.tag, | 46 NavNotifyElement.tag, |
49 ObjectCommonElement.tag, | 47 ObjectCommonElement.tag, |
50 SourceLinkElement.tag, | 48 SourceLinkElement.tag, |
51 SourceInsetElement.tag, | 49 SourceInsetElement.tag, |
52 ViewFooterElement.tag | 50 ViewFooterElement.tag |
53 ]); | 51 ]); |
54 | 52 |
55 RenderingScheduler<FunctionViewElement> _r; | 53 RenderingScheduler<FunctionViewElement> _r; |
56 | 54 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 132 |
135 @override | 133 @override |
136 detached() { | 134 detached() { |
137 super.detached(); | 135 super.detached(); |
138 _r.disable(notify: true); | 136 _r.disable(notify: true); |
139 children = []; | 137 children = []; |
140 } | 138 } |
141 | 139 |
142 void render() { | 140 void render() { |
143 children = [ | 141 children = [ |
144 new NavBarElement(queue: _r.queue) | 142 navBar(_createMenu()), |
145 ..children = _createMenu(), | |
146 new DivElement()..classes = ['content-centered-big'] | 143 new DivElement()..classes = ['content-centered-big'] |
147 ..children = [ | 144 ..children = [ |
148 new HeadingElement.h2()..text = 'Function ${_function.name}', | 145 new HeadingElement.h2()..text = 'Function ${_function.name}', |
149 new HRElement(), | 146 new HRElement(), |
150 new ObjectCommonElement(_isolate, _function, _retainedSizes, | 147 new ObjectCommonElement(_isolate, _function, _retainedSizes, |
151 _reachableSizes, _references, _retainingPaths, | 148 _reachableSizes, _references, _retainingPaths, |
152 _instances, queue: _r.queue), | 149 _instances, queue: _r.queue), |
153 new BRElement(), | 150 new BRElement(), |
154 new DivElement()..classes = ['memberList'] | 151 new DivElement()..classes = ['memberList'] |
155 ..children = _createMembers(), | 152 ..children = _createMembers(), |
(...skipping 17 matching lines...) Expand all Loading... |
173 ]; | 170 ]; |
174 if (_library != null) { | 171 if (_library != null) { |
175 menu.add(new NavLibraryMenuElement(_isolate, _function.dartOwner, | 172 menu.add(new NavLibraryMenuElement(_isolate, _function.dartOwner, |
176 queue: _r.queue)); | 173 queue: _r.queue)); |
177 } else if (_function.dartOwner is M.ClassRef) { | 174 } else if (_function.dartOwner is M.ClassRef) { |
178 menu.add( | 175 menu.add( |
179 new NavClassMenuElement(_isolate, _function.dartOwner, queue: _r.queue) | 176 new NavClassMenuElement(_isolate, _function.dartOwner, queue: _r.queue) |
180 ); | 177 ); |
181 } | 178 } |
182 menu.addAll([ | 179 menu.addAll([ |
183 new NavMenuElement(_function.name, last: true, queue: _r.queue), | 180 navMenu(_function.name), |
184 new NavRefreshElement(queue: _r.queue) | 181 new NavRefreshElement(queue: _r.queue) |
185 ..onRefresh.listen((e) { | 182 ..onRefresh.listen((e) { |
186 e.element.disabled = true; | 183 e.element.disabled = true; |
187 _refresh(); | 184 _refresh(); |
188 }), | 185 }), |
189 new NavNotifyElement(_notifications, queue: _r.queue) | 186 new NavNotifyElement(_notifications, queue: _r.queue) |
190 ]); | 187 ]); |
191 return menu; | 188 return menu; |
192 } | 189 } |
193 | 190 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 case M.FunctionKind.stub: | 384 case M.FunctionKind.stub: |
388 return 'stub'; | 385 return 'stub'; |
389 case M.FunctionKind.tag: | 386 case M.FunctionKind.tag: |
390 return 'tag'; | 387 return 'tag'; |
391 case M.FunctionKind.signatureFunction: | 388 case M.FunctionKind.signatureFunction: |
392 return 'signature function'; | 389 return 'signature function'; |
393 } | 390 } |
394 throw new Exception('Unknown Functionkind ($kind)'); | 391 throw new Exception('Unknown Functionkind ($kind)'); |
395 } | 392 } |
396 } | 393 } |
OLD | NEW |