profileInstruction.setVisible(true);
}
// get the followers of this person
final DefaultTaskInfo task1 = new DefaultTaskInfo(
uiText.FetchingFollowers(), false);
TaskMonitor.getInstance().addTask(task1);
OswServiceFactory.getService().getSubscribers(jid,
new RequestCallback<List<String>>() {
@Override
public void onFailure() {
// TODO Auto-generated method stub
task1.complete("", Status.failure);
}
@Override
public void onSuccess(List<String> result) {
task1.complete("", Status.succes);
// see if there are any results
if (result.size() > 0) {
// sort the list alphabetically
Collections.sort(result, new Comparator<String>() {
@Override
public int compare(String o1, String o2) {
return o1.compareToIgnoreCase(o2);
}
});
// add all the jids to the list
for (final String jid : result) {
Label follower = new Label(jid);
follower.addStyleName("link");
follower.setTitle(uiText.ViewProfileOf() + " " + jid);
followersPanel.add(follower);
follower.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
// get the app instance from the session
// manager
AbstractApplication app = OswClient
.getInstance()
.getCurrentApplication();
ProfileWindow profileWindow = (ProfileWindow) app
.addWindow(ProfileWindow.class
.toString(), 1);
profileWindow.setJID(jid);
profileWindow.show();
}
});
}
} else {
// give a message if there are no followers
followersInstruction
.setText(uiText.NoFollowers());
}
}
});
// get the people who are being followed by this person
final DefaultTaskInfo task2 = new DefaultTaskInfo(
uiText.FetchingFollowing(), false);
TaskMonitor.getInstance().addTask(task2);
OswServiceFactory.getService().getSubscriptions(jid,
new RequestCallback<List<String>>() {
@Override
public void onFailure() {
// TODO Auto-generated method stub
task2.complete("", Status.failure);
}
@Override
public void onSuccess(List<String> result) {
task2.complete("", Status.succes);
// see if there are any results
if (result.size() > 0) {
// sort the list alphabetically
Collections.sort(result, new Comparator<String>() {