Originally fixed as #10189.
Change-Id: I0fe6fbb2452bcdb75fed4ea9ef92ea7b739cbb22
import com.vaadin.client.ui.calendar.schedule.DateCellDayEvent;
import com.vaadin.client.ui.calendar.schedule.DateUtil;
import com.vaadin.client.ui.calendar.schedule.HasTooltipKey;
+import com.vaadin.client.ui.calendar.schedule.MonthEventLabel;
import com.vaadin.client.ui.calendar.schedule.SimpleDayCell;
import com.vaadin.client.ui.calendar.schedule.dd.CalendarDropHandler;
import com.vaadin.client.ui.dd.VHasDropHandler;
((VCalendarAction) action).setEvent(event);
}
return actions;
-
+ } else if (widget instanceof MonthEventLabel) {
+ MonthEventLabel mel = (MonthEventLabel) widget;
+ CalendarEvent event = mel.getCalendarEvent();
+ Action[] actions = CalendarConnector.this
+ .getActionsBetween(event.getStartTime(),
+ event.getEndTime());
+ for (Action action : actions) {
+ ((VCalendarAction) action).setEvent(event);
+ }
+ return actions;
}
return null;
}
import java.util.Date;
+import com.google.gwt.event.dom.client.ContextMenuEvent;
+import com.google.gwt.event.dom.client.ContextMenuHandler;
import com.google.gwt.user.client.ui.HTML;
import com.vaadin.client.ui.VCalendar;
private String caption;
private Date time;
+ private CalendarEvent calendarEvent;
+
/**
* Default constructor
*/
public MonthEventLabel() {
setStylePrimaryName(STYLENAME);
+
+ addDomHandler(new ContextMenuHandler() {
+ @Override
+ public void onContextMenu(ContextMenuEvent event) {
+ calendar.getMouseEventListener().contextMenu(event,
+ MonthEventLabel.this);
+ event.stopPropagation();
+ event.preventDefault();
+ }
+ }, ContextMenuEvent.getType());
+ }
+
+ public void setCalendarEvent(CalendarEvent e) {
+ calendarEvent = e;
}
/**
public Object getTooltipKey() {
return eventIndex;
}
+
+ public CalendarEvent getCalendarEvent() {
+ return calendarEvent;
+ }
}
\ No newline at end of file
eventDiv.addMouseUpHandler(this);
eventDiv.setCalendar(calendar);
eventDiv.setEventIndex(e.getIndex());
+ eventDiv.setCalendarEvent(e);
if (timeEvent) {
eventDiv.setTimeSpecificEvent(true);