Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: runtime/observatory/lib/src/elements/instance_ref.dart

Issue 1977873003: Allow users to see more elements of a list/map in Observatory. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fix problems found during testing Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/instance_ref.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 instance_ref_element; 5 library instance_ref_element;
6 6
7 import 'dart:async';
7 import 'package:polymer/polymer.dart'; 8 import 'package:polymer/polymer.dart';
8 import 'package:observatory/service.dart'; 9 import 'package:observatory/service.dart';
9 import 'service_ref.dart'; 10 import 'service_ref.dart';
10 11
11 @CustomTag('instance-ref') 12 @CustomTag('instance-ref')
12 class InstanceRefElement extends ServiceRefElement { 13 class InstanceRefElement extends ServiceRefElement {
13 InstanceRefElement.created() : super.created(); 14 InstanceRefElement.created() : super.created();
14 15
15 String get hoverText { 16 String get hoverText {
16 if (ref != null) { 17 if (ref != null) {
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 Instance refMap = ref; 52 Instance refMap = ref;
52 refMap.fields = null; 53 refMap.fields = null;
53 refMap.elements = null; 54 refMap.elements = null;
54 onDone(); 55 onDone();
55 } 56 }
56 } 57 }
57 58
58 String makeExpandKey(String key) { 59 String makeExpandKey(String key) {
59 return '${expandKey}/${key}'; 60 return '${expandKey}/${key}';
60 } 61 }
62
63 Future showMore() async {
64 Instance instance = ref;
65 if (instance.isList) {
66 await instance.reload(count: instance.elements.length * 2);
67 } else if (instance.isMap) {
68 await instance.reload(count: instance.associations.length * 2);
69 } else if (instance.isTypedData) {
70 await instance.reload(count: instance.typedElements.length * 2);
71 }
72 }
61 } 73 }
OLDNEW
« no previous file with comments | « no previous file | runtime/observatory/lib/src/elements/instance_ref.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698