private List<String> createLinkList(Iterator iter, String groupname) {
List<String> entries = new ArrayList<String>();
Link link;
for (Iterator i = iter; i.hasNext();) {
RosterEntry entry = (RosterEntry) i.next();
String entryPresence = getUserPresence(entry.getUser());
if (getShowOfflineBuddies() || entryPresence != "offline") {
if (groupname != null) {
link = LinkFactory.createCustomLink(entry.getUser()+createAppendixFromGroupName(groupname), "cmd.chat", "", Link.NONTRANSLATED, vc, controller);
} else {
link = LinkFactory.createCustomLink(entry.getUser(), "cmd.chat", "", Link.NONTRANSLATED, vc, controller);
}
Identity ident = ManagerFactory.getManager().findIdentityByName(entry.getName());
if (ident != null) {
link.setCustomDisplayText(ident.getUser().getProperty(UserConstants.FIRSTNAME, null)+" "+ident.getUser().getProperty(UserConstants.LASTNAME, null)+" ("+ident.getName()+")");
} else {
link.setCustomDisplayText(entry.getName());
}
link.setCustomEnabledLinkCSS("o_instantmessaging_" + entryPresence +"_icon");
link.setUserObject(entry.getUser());
StringBuilder sb = new StringBuilder();
if (!imc.isChatDisabled()) {
sb.append(translator.translate("im.status")).append(" ");
sb.append(translator.translate("presence."+entryPresence));
sb.append("<br />");
if(ident != null){
//TODO:gs:a how to get the roster entries presence msg? new clienthelper will work but creates a im client!
sb.append(translator.translate("im.status.msg")).append(" ").append("");
}
sb.append("<br /><br />");
sb.append(translator.translate("im.start.chat"));
} else {
sb.append(translator.translate("im.chat.disabled"));
}
link.setTooltip(sb.toString(), false);
link.registerForMousePositionEvent(true);
entries.add(entry.getUser());
}
}
return entries;
}