public void mouseDoubleClick(MouseEvent event) {
if (control instanceof Tree) {
TreeItem treeItem = ((Tree) control).getItem(new Point(
event.x, event.y));
if (treeItem != null) {
User user = (User) Platform.getAdapterManager()
.getAdapter(treeItem.getData(), User.class);
if (user != null) {
editorManager.jumpToUser(user);
return;
}
RosterEntryElement rosterEntryElement = (RosterEntryElement) Platform
.getAdapterManager().getAdapter(treeItem.getData(),
RosterEntryElement.class);
ChatControl chatControl = chatRooms
.getActiveChatControl();
/*
* TODO create links like those of the World of Warcraft
* chat which then can be clicked to execute some action
* e.g inviting user to a session are add them to the
* roster (but should not be done here at all)
*/
if (rosterEntryElement != null && chatControl != null) {
String currentText = chatControl.getInputText();
chatControl.setInputText(currentText + "["
+ rosterEntryElement.getJID().getBase() + "]");
}
}
} else {
log.warn("Control is not instance of Tree.");
}
}
@Override
public void mouseDown(MouseEvent event) {
if (control instanceof Tree) {
TreeItem treeItem = ((Tree) control).getItem(new Point(
event.x, event.y));
if (treeItem != null) {
User user = (User) Platform.getAdapterManager()
.getAdapter(treeItem.getData(), User.class);
fmAction.setFollowModeActionStatus(user);
}
} else {
log.warn("Control is not instance of Tree.");