Fixes vaadin/framework8-issues#525tags/8.0.0.alpha9
@@ -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, |
@@ -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()); |
@@ -19,7 +19,7 @@ public class ButtonHtml extends TestBase { | |||
b = new Button( | |||
"<span style=\"color: red; font-weight: bold;\">HTML</span> button"); | |||
b.setHtmlContentAllowed(true); | |||
b.setCaptionAsHtml(true); | |||
addComponent(b); | |||
final Button swapButton = new Button("<i>Swap button<i>"); | |||
@@ -27,8 +27,7 @@ public class ButtonHtml extends TestBase { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
swapButton.setHtmlContentAllowed( | |||
!swapButton.isHtmlContentAllowed()); | |||
swapButton.setCaptionAsHtml(!swapButton.isCaptionAsHtml()); | |||
} | |||
}); | |||
addComponent(swapButton); |
@@ -14,7 +14,7 @@ public class NativeButtonHtml extends TestBase { | |||
b = new NativeButton( | |||
"<span style=\"color: red; font-weight: bold;\">HTML</span> button"); | |||
b.setHtmlContentAllowed(true); | |||
b.setCaptionAsHtml(true); | |||
addComponent(b); | |||
final NativeButton swapButton = new NativeButton("<i>Swap button<i>"); | |||
@@ -22,8 +22,7 @@ public class NativeButtonHtml extends TestBase { | |||
@Override | |||
public void buttonClick(ClickEvent event) { | |||
swapButton.setHtmlContentAllowed( | |||
!swapButton.isHtmlContentAllowed()); | |||
swapButton.setCaptionAsHtml(!swapButton.isCaptionAsHtml()); | |||
} | |||
}); | |||
addComponent(swapButton); |
@@ -46,9 +46,9 @@ import com.vaadin.ui.HorizontalLayout; | |||
import com.vaadin.ui.Label; | |||
import com.vaadin.ui.MenuBar; | |||
import com.vaadin.ui.MenuBar.MenuItem; | |||
import com.vaadin.ui.themes.ValoTheme; | |||
import com.vaadin.ui.Notification; | |||
import com.vaadin.ui.UI; | |||
import com.vaadin.ui.themes.ValoTheme; | |||
import com.vaadin.v7.data.Container; | |||
import com.vaadin.v7.data.Container.Hierarchical; | |||
import com.vaadin.v7.data.Item; | |||
@@ -197,7 +197,7 @@ public class ValoThemeUI extends UI { | |||
b.setIcon(FontAwesome.TH_LIST); | |||
b.setPrimaryStyleName(ValoTheme.MENU_ITEM); | |||
b.addStyleName("selected"); | |||
b.setHtmlContentAllowed(true); | |||
b.setCaptionAsHtml(true); | |||
menu.addComponent(b); | |||
b = new Button("API"); | |||
@@ -326,7 +326,7 @@ public class ValoThemeUI extends UI { | |||
b.setCaption(b.getCaption() | |||
+ " <span class=\"valo-menu-badge\">123</span>"); | |||
} | |||
b.setHtmlContentAllowed(true); | |||
b.setCaptionAsHtml(true); | |||
b.setPrimaryStyleName(ValoTheme.MENU_ITEM); | |||
b.setIcon(testIcon.get()); | |||
menuItemsLayout.addComponent(b); |