+ // TODO: i18n + do it properly
+ infoPanel.addComponent(UiColors.Element.VIEW_CONTACT_NAME
+ .createLabel(name));
+
+ infoPanel.addComponent(UiColors.Element.VIEW_CONTACT_NORMAL
+ .createLabel(""));
+ infoPanel.addComponent(UiColors.Element.VIEW_CONTACT_NORMAL
+ .createLabel("Phone: "
+ + contact.getPreferredDataValue("TEL")));
+ infoPanel.addComponent(UiColors.Element.VIEW_CONTACT_NORMAL
+ .createLabel("eMail: "
+ + contact.getPreferredDataValue("EMAIL")));
+ infoPanel.addComponent(UiColors.Element.VIEW_CONTACT_NORMAL
+ .createLabel(""));
+
+ String notes = contact.getPreferredDataValue("NOTE");
+ if (notes == null)
+ notes = "";
+ note.setText(notes.replaceAll("\\\\n", "\n"));
+
+ Data photo = contact.getPreferredData("PHOTO");
+ if (photo != null) {
+ TypeInfo encoding = null;
+ for (int index = 0; index < photo.size(); index++) {
+ TypeInfo info = photo.get(index);
+ if (info.getName() != null) {
+ if (info.getName().equalsIgnoreCase("ENCODING"))
+ encoding = info;
+ // We don't check for the "TYPE" anymore, we just defer
+ // it to ImageIcon
+ }
+ }
+
+ if (encoding != null && encoding.getValue() != null
+ && encoding.getValue().equalsIgnoreCase("b")) {
+
+ try {
+ image = ImageIO.read(new ByteArrayInputStream(
+ DatatypeConverter.parseBase64Binary(photo
+ .getValue())));
+ image.toString();
+ } catch (Exception e) {
+ System.err.println("Cannot parse image for contact: "
+ + contact.getPreferredDataValue("UID"));
+ }
+ }
+ }