String user = event.location.substring(7);
// System.out.println(user + " vs. " +
// chat.getParticipant());
if (chat != null && StringUtils.parseBareAddress(user)
.equals(StringUtils.parseBareAddress(chat.getJID()))) {
EntryMenu menu = (EntryMenu) chatParticipantStatus
.getParent().getData("entryMenu");
menu
.open(
account,
account.xmpp
.getRoster()
.getEntry(
StringUtils
.parseBareAddress(user)),
null);
}
} else if (event.location.startsWith("http://")) {
try {
PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL(event.location));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
}
event.doit = false;
}
}
});
chatHistory.addMouseListener(new org.eclipse.swt.events.MouseAdapter() {
public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
System.out.println("Data: " + e.data);
}
});
Menu menu = new Menu(chatHistory.getShell(),SWT.POP_UP);
// TODO add context menu to chat history ..
menu.addListener(SWT.Show, new Listener() {
public void handleEvent(Event event) {
}
});
chatHistory.setMenu(menu);