diff options
author | Artur <artur@vaadin.com> | 2017-02-22 13:36:45 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-03-16 16:21:24 +0200 |
commit | c7d3e3859d444938f6d4f4b0dd563e2609e39762 (patch) | |
tree | f3990df74c966bf8f2fcda0789f2f5f492eb5200 /server | |
parent | 82af8b5bcc73500e69d5ebd6770f4360ebefbe87 (diff) | |
download | vaadin-framework-c7d3e3859d444938f6d4f4b0dd563e2609e39762.tar.gz vaadin-framework-c7d3e3859d444938f6d4f4b0dd563e2609e39762.zip |
Add support for rendering HTML in ButtonRenderer (#8606)
Diffstat (limited to 'server')
-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; + } } |