blob: e03e1d28477497cb6e2ea297805338355f1e110c [file] [log] [blame]
<head>
<link rel="import" href="curly_block.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>
<style>
.member {
vertical-align: top;
padding: 1px 0 1px 1em;
}
</style>
<div>
<template if="{{ isUnexpected(ref.serviceType) }}">
unexpected reference type &lt;{{ ref.serviceType }}&gt;
</template>
<template if="{{ isError(ref.serviceType) }}">
<pre>{{ ref.message }}</pre>
</template>
<template if="{{ isNull(ref.serviceType) }}">
<div title="{{ hoverText }}">{{ ref['preview'] }}</div>
</template>
<template if="{{ (isString(ref.serviceType) ||
isBool(ref.serviceType) ||
isInt(ref.serviceType)) }}">
<a href="{{ url }}">{{ ref['preview'] }}</a>
</template>
<template if="{{ isClosure(ref.serviceType) }}">
<a href="{{ url }}">
{{ ref['closureFunc']['user_name'] }}
</a>
</template>
<template if="{{ isInstance(ref.serviceType) }}">
<a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em></a>
<curly-block callback="{{ expander() }}">
<table>
<tr template repeat="{{ field in ref['fields'] }}">
<td class="member">{{ field['decl']['user_name'] }}</td>
<td class="member">
<instance-ref ref="{{ field['value'] }}"></instance-ref>
</td>
</tr>
</table>
</curly-block>
</template>
<template if="{{ isList(ref.serviceType) }}">
<a href="{{ url }}"><em>{{ ref['class']['user_name'] }}</em> ({{ ref['length']}})</a>
<curly-block callback="{{ expander() }}">
<table>
<tr template repeat="{{ element in ref['elements'] }}">
<td class="member">[{{ element['index']}}]</td>
<td class="member">
<instance-ref ref="{{ element['value'] }}"></instance-ref>
</td>
</tr>
</table>
</curly-block>
</template>
</div>
</template>
<script type="application/dart" src="instance_ref.dart"></script>
</polymer-element>