From f3d768252903b8c184cc7d8a77b70ccddc5ef20f Mon Sep 17 00:00:00 2001 From: Artur Date: Wed, 22 Feb 2017 13:36:45 +0200 Subject: Add support for rendering HTML in ButtonRenderer (#8606) --- .../com/vaadin/ui/renderers/ButtonRenderer.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'server/src/main/java/com/vaadin/ui/renderers') diff --git a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java index b9eec4714b..40269adb26 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java @@ -83,4 +83,28 @@ public class ButtonRenderer extends ClickableRenderer { return (ButtonRendererState) super.getState(markAsDirty); } + /** + * Sets whether the data should be rendered as HTML (instead of text). + *

+ * By default everything is rendered as text. + * + * @param htmlContentAllowed + * true to render as HTML, false to + * render as text + */ + public void setHtmlContentAllowed(boolean htmlContentAllowed) { + getState().htmlContentAllowed = htmlContentAllowed; + } + + /** + * Gets whether the data should be rendered as HTML (instead of text). + *

+ * By default everything is rendered as text. + * + * @return true if the renderer renders a HTML, + * false if the content is rendered as text + */ + public boolean isHtmlContentAllowed() { + return getState(false).htmlContentAllowed; + } } -- cgit v1.2.3