}
private void setTooltipText(TooltipInfo info) {
- if (info.getErrorMessage() != null) {
+ if (info.getErrorMessage() != null && !info.getErrorMessage().isEmpty()) {
em.setVisible(true);
em.updateMessage(info.getErrorMessage());
} else {
em.setVisible(false);
}
- if (info.getTitle() != null && !"".equals(info.getTitle())) {
+ if (info.getTitle() != null && !info.getTitle().isEmpty()) {
description.setInnerHTML(info.getTitle());
description.getStyle().clearDisplay();
} else {
*
*/
private void showTooltip() {
- boolean hasContent = false;
- if (currentTooltipInfo.getErrorMessage() != null
- || (currentTooltipInfo.getTitle() != null && !""
- .equals(currentTooltipInfo.getTitle()))) {
- hasContent = true;
- }
- if (hasContent) {
+ if (currentTooltipInfo.hasMessage()) {
// Issue #8454: With IE7 the tooltips size is calculated based on
// the last tooltip's position, causing problems if the last one was
// in the right or bottom edge. For this reason the tooltip is moved
handledByFocus = isFocused;
currentElement = element;
}
-
}
private final TooltipEventHandler tooltipEventHandler = new TooltipEventHandler();
StringBuilder sb = new StringBuilder();
for (ErrorMessage cause : getCauses()) {
String childMessage = cause.getFormattedHtmlMessage();
- if (null != childMessage) {
+ if (null != childMessage && !childMessage.isEmpty()) {
sb.append("<div>");
sb.append(childMessage);
sb.append("</div>\n");