@Override
public boolean onMouseDown(MouseDownEvent event, Element context) {
if (event.getNativeButton() != NativeEvent.BUTTON_LEFT) {
return false;
}
BlipMenuItemView item = panel.asBlipMenuItem(context);
switch (item.getOption()) {
case EDIT:
actions.startEditing(item.getParent().getParent());
break;
case EDIT_DONE:
actions.stopEditing();
break;
case REPLY:
actions.reply(item.getParent().getParent());
break;
case DELETE:
// We delete the blip without confirmation if shift key is pressed
if (event.getNativeEvent().getShiftKey() || Window.confirm(messages.confirmDeletion())) {
actions.delete(item.getParent().getParent());
}
break;
case LINK:
actions.popupLink(item.getParent().getParent());
break;
default:
throw new AssertionError();
}
event.preventDefault();