Vaadin Calendar allows the use of context menu (mouse right-click) to manage
events. As in other context menus in Vaadin, the menu items are handled in
Vaadin as actions by an action
handler. To enable a context menu, you have to implement a Vaadin
Action.Handler
and add it to the calendar with
addActionHandler()
.
An action handler must implement two methods:
getActions()
and
handleAction()
. The
getActions()
is called for each day displayed in the
calendar view. It should return a list of allowed actions for that day, that
is, the items of the context menu. The target
parameter
is the context of the click - a CalendarDateRange
that
spans over the day. The sender
is the
Calendar
object.
The handleActions()
receives the target context in
the target
. If the context menu was opened on an event,
the target is the Event
object, otherwise it is
a CalendarDateRange
.