// Fill with the related data for CountryCode
final CountryCode cc = ip2.getCountryCode();
if (cc != null) {
/* Flag-image */
final Image img = new Image();
final String path = "/images/countrycode_flags/";
final String flag = StringUtils.lowerCase(cc.getCcdCode2()) + ".gif";
img.setSrc(path + flag);
hbox.appendChild(img);
final Separator sep = new Separator();
hbox.appendChild(sep);
/* Country */
final Label label = new Label();
label.setValue(cc.getCcdCode2());
hbox.appendChild(label);
// show other stuff from the Ip2Country
/* Provider-City */
final Label label2 = new Label();
if (StringUtils.isNotBlank(ip2.getI2cCity())) {
label2.setValue("(" + ip2.getI2cCity() + ")");
} else {
label2.setValue("");
}
hbox.appendChild(label2);
}
lc.setParent(item);
} else {
lc = new Listcell();
final Hbox hbox = new Hbox();
hbox.setParent(lc);
/* Flag-image */
final Image img = new Image();
final String path = "/images/countrycode_flags/";
final String flag = "xx.gif";
img.setSrc(path + flag);
hbox.appendChild(img);
final Label label = new Label();
label.setValue("Unknown");
hbox.appendChild(label);