diff options
author | Aleksi Hietanen <aleksi@vaadin.com> | 2016-12-08 10:57:52 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2016-12-08 10:57:52 +0200 |
commit | 205efc49bf44c3d9150c970906bde7c152ecc2ff (patch) | |
tree | a8b50e397ae9d41360615307c3ba84c7ae54b347 /server | |
parent | 9fb43988c7335167d40b01479265e41cad55d301 (diff) | |
download | vaadin-framework-205efc49bf44c3d9150c970906bde7c152ecc2ff.tar.gz vaadin-framework-205efc49bf44c3d9150c970906bde7c152ecc2ff.zip |
Deprecate Button#setHtmlContentAllowed (#104)
Fixes vaadin/framework8-issues#525
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Button.java | 8 | ||||
-rw-r--r-- | server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Button.java b/server/src/main/java/com/vaadin/ui/Button.java index 4a8e9b4b92..afa325ad1e 100644 --- a/server/src/main/java/com/vaadin/ui/Button.java +++ b/server/src/main/java/com/vaadin/ui/Button.java @@ -541,7 +541,10 @@ public class Button extends AbstractFocusable * @param htmlContentAllowed * <code>true</code> if caption is rendered as HTML, * <code>false</code> otherwise + * + * @deprecated as of 8.0.0, use {@link #setCaptionAsHtml(boolean)} instead. */ + @Deprecated public void setHtmlContentAllowed(boolean htmlContentAllowed) { getState().captionAsHtml = htmlContentAllowed; } @@ -551,7 +554,10 @@ public class Button extends AbstractFocusable * * @return <code>true</code> if the caption text is to be rendered as HTML, * <code>false</code> otherwise + * + * @deprecated as of 8.0.0, use {@link #isCaptionAsHtml()} instead. */ + @Deprecated public boolean isHtmlContentAllowed() { return getState(false).captionAsHtml; } @@ -571,7 +577,7 @@ public class Button extends AbstractFocusable Boolean plain = DesignAttributeHandler .readAttribute(DESIGN_ATTR_PLAIN_TEXT, attr, Boolean.class); if (plain == null || !plain) { - setHtmlContentAllowed(true); + setCaptionAsHtml(true); content = design.html(); } else { // content is not intended to be interpreted as HTML, diff --git a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java index 946c7654d6..70f93e7cff 100644 --- a/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java +++ b/server/src/test/java/com/vaadin/tests/server/component/button/ButtonDeclarativeTest.java @@ -100,12 +100,12 @@ public class ButtonDeclarativeTest extends DeclarativeTestBase<Button> { Assert.assertEquals(expectedCaptionHtml, nativeButton.getCaption()); read = new Button("& Test"); - read.setHtmlContentAllowed(true); + read.setCaptionAsHtml(true); Element root = new Element(Tag.valueOf("vaadin-button"), ""); read.writeDesign(root, new DesignContext()); assertEquals("& Test", root.html()); - read.setHtmlContentAllowed(false); + read.setCaptionAsHtml(false); root = new Element(Tag.valueOf("vaadin-button"), ""); read.writeDesign(root, new DesignContext()); assertEquals("&amp; Test", root.html()); |