diff options
author | Artur <artur@vaadin.com> | 2017-02-22 13:36:45 +0200 |
---|---|---|
committer | Aleksi Hietanen <aleksi@vaadin.com> | 2017-02-22 13:36:45 +0200 |
commit | f3d768252903b8c184cc7d8a77b70ccddc5ef20f (patch) | |
tree | d6c04079289e66e548f780d9eae6cef52f2edbc7 /server/src/main/java/com/vaadin/ui/renderers | |
parent | 1718666cd6a0aac7273e12d5bad459dea9fe997c (diff) | |
download | vaadin-framework-f3d768252903b8c184cc7d8a77b70ccddc5ef20f.tar.gz vaadin-framework-f3d768252903b8c184cc7d8a77b70ccddc5ef20f.zip |
Add support for rendering HTML in ButtonRenderer (#8606)
Diffstat (limited to 'server/src/main/java/com/vaadin/ui/renderers')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/renderers/ButtonRenderer.java | 24 |
1 files changed, 24 insertions, 0 deletions
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<T> extends ClickableRenderer<T, String> { return (ButtonRendererState) super.getState(markAsDirty); } + /** + * Sets whether the data should be rendered as HTML (instead of text). + * <p> + * By default everything is rendered as text. + * + * @param htmlContentAllowed + * <code>true</code> to render as HTML, <code>false</code> to + * render as text + */ + public void setHtmlContentAllowed(boolean htmlContentAllowed) { + getState().htmlContentAllowed = htmlContentAllowed; + } + + /** + * Gets whether the data should be rendered as HTML (instead of text). + * <p> + * By default everything is rendered as text. + * + * @return <code>true</code> if the renderer renders a HTML, + * <code>false</code> if the content is rendered as text + */ + public boolean isHtmlContentAllowed() { + return getState(false).htmlContentAllowed; + } } |