- break;
- case 1:
- for (TypeInfo type : data.getTypes()) {
- if (valueBuilder.length() > 1)
- valueBuilder.append(", ");
- valueBuilder.append(type.getName());
- valueBuilder.append(": ");
- valueBuilder.append(type.getValue());
+
+ // 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;
+ TypeInfo type = 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;
+ if (info.getName().equalsIgnoreCase("TYPE"))
+ type = info;
+ }
+ }
+
+ if (encoding != null && encoding.getValue() != null
+ && encoding.getValue().equalsIgnoreCase("b")) {
+
+ image = new ImageIcon(Base64.getDecoder().decode(
+ photo.getValue())).getImage();
+ }