package pt.ist.fenixWebFramework.renderers; import pt.ist.fenixWebFramework.renderers.components.HtmlComponent; import pt.ist.fenixWebFramework.renderers.components.HtmlText; import pt.ist.fenixWebFramework.renderers.layouts.Layout; import pt.ist.fenixWebFramework.renderers.utils.RenderUtils; public class SlotAsLabelRenderer extends OutputRenderer { private String bundle; public String getBundle() { return this.bundle; } public void setBundle(String bundle) { this.bundle = bundle; } @Override protected Layout getLayout(Object object, Class type) { return new Layout() { @Override public HtmlComponent createComponent(Object object, Class type) { final String key = (String) object; final String label = RenderUtils.getResourceString(getBundle(), key); return new HtmlText(label); } }; } }