\r
public static void showNotification(ApplicationConnection client,\r
final UIDL notification) {\r
- boolean htmlContentAllowed = notification\r
- .hasAttribute(VView.NOTIFICATION_HTML_CONTENT_ALLOWED);\r
+ boolean onlyPlainText = notification\r
+ .hasAttribute(VView.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED);\r
String html = "";\r
if (notification.hasAttribute("icon")) {\r
final String parsedUri = client.translateVaadinUri(notification\r
}\r
if (notification.hasAttribute("caption")) {\r
String caption = notification.getStringAttribute("caption");\r
- if (!htmlContentAllowed) {\r
+ if (onlyPlainText) {\r
caption = Util.escapeHTML(caption);\r
caption = caption.replaceAll("\\n", "<br />");\r
}\r
}\r
if (notification.hasAttribute("message")) {\r
String message = notification.getStringAttribute("message");\r
- if (!htmlContentAllowed) {\r
+ if (onlyPlainText) {\r
message = Util.escapeHTML(message);\r
message = message.replaceAll("\\n", "<br />");\r
}\r
if (n.getIcon() != null) {
target.addAttribute("icon", n.getIcon());
}
- if (n.isHtmlContentAllowed()) {
+ if (!n.isHtmlContentAllowed()) {
target.addAttribute(
- VView.NOTIFICATION_HTML_CONTENT_ALLOWED, true);
+ VView.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, true);
}
target.addAttribute("position", n.getPosition());
target.addAttribute("delay", n.getDelayMsec());