package pt.ist.renderers; import pt.ist.renderers.components.HtmlComponent; import pt.ist.renderers.components.HtmlPreformattedText; import pt.ist.renderers.components.HtmlText; import pt.ist.renderers.layouts.Layout; public class CodeRenderer extends OutputRenderer { @Override protected Layout getLayout(Object object, Class type) { return new Layout() { @Override public HtmlComponent createComponent(Object object, Class type) { String text = (String) object; if (text == null) { return new HtmlText(); } HtmlPreformattedText container = new HtmlPreformattedText(); container.setIndented(false); container.addChild(new HtmlText(text, true, true)); return container; } }; } }