1 /*******************************************************************************
\r
2 * Copyright (c) 2016 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * THTH ry - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.debug.browser.sections;
\r
14 import java.io.PrintWriter;
\r
16 import org.simantics.db.ReadGraph;
\r
17 import org.simantics.db.exception.DatabaseException;
\r
18 import org.simantics.debug.browser.utils.Escapes;
\r
19 import org.simantics.debug.browser.utils.ValueInfo;
\r
21 public class ResourceInfoSection implements ResourceBrowserSection {
\r
23 ValueInfo valueInfo;
\r
26 public ResourceInfoSection(ValueInfo valueInfo, boolean immutable) {
\r
27 this.valueInfo = valueInfo;
\r
28 this.immutable = immutable;
\r
32 public double getPriority() {
\r
37 public void toHtml(ReadGraph graph, PrintWriter out) throws DatabaseException {
\r
38 out.println("<div id=\"resourceInfoContent\">");
\r
39 out.println("<table>");
\r
41 out.println("<tr><td colspan=\"2\" id=\"immutable\">IMMUTABLE</td></tr>");
\r
43 if (valueInfo != null) {
\r
44 if (valueInfo.datatype != null) {
\r
46 out.print("<td class=\"top_key\">Attached value data type</td>");
\r
47 out.print("<td class=\"resourceType\">");
\r
48 out.print(Escapes.html(valueInfo.datatype));
\r
49 out.println("</td></tr>");
\r
51 out.print("<tr><td class=\"top_key\">Attached value</td>");
\r
52 out.print("<td id=\"attachedValue\">");
\r
53 out.print(Escapes.html(valueInfo.value));
\r
54 out.println("</td></tr>");
\r
56 out.println("</table>");
\r
57 out.println("</div>");
\r