}
return false;
}
protected HtmlComponent getValue(PartyContact contact) {
HtmlInlineContainer span = new HtmlInlineContainer();
if (contact instanceof Phone) {
span.addChild(new HtmlText(((Phone) contact).getNumber()));
} else if (contact instanceof MobilePhone) {
span.addChild(new HtmlText(((MobilePhone) contact).getNumber()));
} else if (contact instanceof EmailAddress) {
EmailAddress email = (EmailAddress) contact;
if (isPublicSpace()) {
HtmlImage img = new HtmlImage();
img.setSource(RenderUtils.getContextRelativePath("") + "/publico/viewHomepage.do?method=emailPng&email="
+ email.getExternalId());
span.addChild(img);
} else {
HtmlLink link = new HtmlLink();
link.setModuleRelative(false);
link.setContextRelative(false);
link.setUrl("mailto:" + email.getValue());
link.setBody(new HtmlText(email.getValue()));
span.addChild(link);
}
} else if (contact instanceof WebAddress) {
HtmlLink link = new HtmlLink();
link.setModuleRelative(false);
link.setContextRelative(false);
link.setUrl(((WebAddress) contact).getPresentationValue());
link.setBody(new HtmlText(((WebAddress) contact).getPresentationValue()));
span.addChild(link);
}
if (showType || (showDefault && contact.isDefault())) {
StringBuilder suffix = new StringBuilder();
suffix.append(" (");
if (showType) {
suffix.append(RenderUtils.getEnumString(contact.getType()));
}
if (showDefault && contact.isDefault()) {
if (showType) {
suffix.append(", ");
}
suffix.append(RenderUtils.getResourceString(getBundle(), getDefaultLabel()));
}
suffix.append(")");
span.addChild(new HtmlText(suffix.toString()));
}
return span;
}