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