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

Unified Diff: runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html

Issue 164183003: Add expandable instances and lists to the vm service. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: gen js Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html
diff --git a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html
index ecf3f0679d06e0b9bf881dffbab97d6f85ff9e9a..4bb20cf68717c6d782bb85ada5a3b414a9408ed8 100644
--- a/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html
+++ b/runtime/bin/vmservice/client/lib/src/observatory_elements/instance_ref.html
@@ -1,20 +1,69 @@
<head>
-<link rel="import" href="observatory_element.html">
-<link rel="import" href="service_ref.html">
+ <link rel="import" href="observatory_element.html">
+ <link rel="import" href="service_ref.html">
</head>
<polymer-element name="instance-ref" extends="service-ref">
-<template>
-<div>
- <template if="{{ (ref['type'] == 'null') }}">
- unexpected null
+ <template>
+ <style>
+ .memberList {
+ margin-left: 3em;
+ border-spacing: 0;
+ border-collapse: collapse;
+ }
+ .member {
+ vertical-align: top;
+ padding: 0 1em;
+ }
+ </style>
+ <div>
+ <template if="{{ isUnexpectedRef(ref['type']) }}">
+ unexpected reference type &lt;{{ ref['type'] }}&gt;
+ </template>
+
+ <template if="{{ isNullRef(ref['type']) }}">
+ {{ name }}
+ </template>
+
+ <template if="{{ (isStringRef(ref['type']) ||
+ isBoolRef(ref['type']) ||
+ isIntRef(ref['type'])) }}">
+ <a href="{{ url }}">{{ name }}</a>
+ </template>
+
+ <template if="{{ isInstanceRef(ref['type']) }}">
+ <a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em></a> {
+ <a on-click="{{ toggleExpand }}">...</a>
+ <template if="{{ expanded }}">
+ <table class="memberList">
+ <tr template repeat="{{ field in ref['fields'] }}">
+
+ <td class="member">{{ field['decl']['user_name'] }}</td>
+ <td class="member">
+ <instance-ref app="{{ app }}" ref="{{ field['value'] }}"></instance-ref>
+ </td>
+ </tr>
+ </table>
+ </template>
+ }
+ </template>
+
+ <template if="{{ isListRef(ref['type']) }}">
+ <a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em> ({{ ref['length']}})</a> {
+ <a on-click="{{ toggleExpand }}">...</a>
+ <template if="{{ expanded }}">
+ <table class="memberList">
+ <tr template repeat="{{ element in ref['elements'] }}">
+ <td class="member">[{{ element['index']}}]</td>
+ <td class="member">
+ <instance-ref app="{{ app }}" ref="{{ element['value'] }}"></instance-ref>
+ </td>
+ </tr>
+ </table>
+ </template>
+ }
+ </template>
+
+ </div>
</template>
- <template if="{{ (ref['type'] == '@Null') }}">
- {{ name }}
- </template>
- <template if="{{ (ref['type'] != 'null') && ref['type'] != '@Null' }}">
- <a href="{{ url }}">{{ name }} </a>
- </template>
- </div>
-</template>
-<script type="application/dart" src="instance_ref.dart"></script>
+ <script type="application/dart" src="instance_ref.dart"></script>
</polymer-element>

Powered by Google App Engine
This is Rietveld 408576698