Class FullCalendarContextMenu
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,FullCalendarMenuItem,FullCalendarSubMenu>
io.jmix.fullcalendarflowui.component.contextmenu.FullCalendarContextMenu
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier
,com.vaadin.flow.component.DetachNotifier
,com.vaadin.flow.component.HasComponents
,com.vaadin.flow.component.HasElement
,com.vaadin.flow.component.HasEnabled
,com.vaadin.flow.component.HasStyle
,HasFullCalendarMenuItems
,Serializable
public class FullCalendarContextMenu
extends com.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,FullCalendarMenuItem,FullCalendarSubMenu>
implements HasFullCalendarMenuItems
Component for context menu in
FullCalendar
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
com.vaadin.flow.component.contextmenu.ContextMenuBase.OpenedChangeEvent<TComponent extends com.vaadin.flow.component.contextmenu.ContextMenuBase<TComponent,
?, ?>> Nested classes/interfaces inherited from interface io.jmix.fullcalendarflowui.component.contextmenu.HasFullCalendarMenuItems
HasFullCalendarMenuItems.FullCalendarClickContextMenuItemEvent
-
Field Summary
Modifier and TypeFieldDescriptionprotected FullCalendarCellContext
protected Function<FullCalendarCellContext,
Boolean> protected FullCalendarDeserializer
Fields inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
EVENT_DETAIL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.Registration
addContextMenuOpenedListener
(com.vaadin.flow.component.ComponentEventListener<FullCalendarContextMenuOpenedEvent> listener) Adds a listener to handle changing opened/closed state.addItem
(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<HasFullCalendarMenuItems.FullCalendarClickContextMenuItemEvent> clickListener) Adds new menu item.addItem
(String text, com.vaadin.flow.component.ComponentEventListener<HasFullCalendarMenuItems.FullCalendarClickContextMenuItemEvent> clickListener) Adds new menu item.static FullCalendarContextMenu
create
(FullCalendar target) Creates new instance of context menu with providedFullCalendar
target.protected com.vaadin.flow.component.contextmenu.MenuManager<FullCalendarContextMenu,
FullCalendarMenuItem, FullCalendarSubMenu> createMenuManager
(com.vaadin.flow.function.SerializableRunnable contentReset) protected boolean
onBeforeOpenMenu
(elemental.json.JsonObject eventDetail) void
setContentMenuHandler
(Function<FullCalendarCellContext, Boolean> contentMenuHandler) Sets a handler to configure content of context menu.void
setTarget
(com.vaadin.flow.component.Component target) Methods inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
add, addComponentAtIndex, addItem, addItem, addOpenedChangeListener, close, getChildren, getItems, getMenuManager, isOpened, isOpenOnClick, remove, removeAll, setOpenOnClick
Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListener
Methods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListener
Methods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, remove
Methods inherited from interface com.vaadin.flow.component.HasElement
getElement
Methods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabled
Methods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Field Details
-
cellContext
-
contentMenuHandler
-
deserializer
-
-
Constructor Details
-
FullCalendarContextMenu
public FullCalendarContextMenu() -
FullCalendarContextMenu
-
-
Method Details
-
create
Creates new instance of context menu with providedFullCalendar
target.- Parameters:
target
- calendar to bound with a context menu- Returns:
- new instance of context menu
-
addContextMenuOpenedListener
public com.vaadin.flow.shared.Registration addContextMenuOpenedListener(com.vaadin.flow.component.ComponentEventListener<FullCalendarContextMenuOpenedEvent> listener) Adds a listener to handle changing opened/closed state.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener from context menu
-
getContentMenuHandler
-
setContentMenuHandler
public void setContentMenuHandler(@Nullable Function<FullCalendarCellContext, Boolean> contentMenuHandler) Sets a handler to configure content of context menu. For instance:contextMenu.setContentMenuHandler(context -> { contextMenu.removeAll(); if (context.getCalendarEvent() != null) { contextMenu.addItem("Event menu item", event -> {}); // do something return true; } else if (context.getDayCell() != null) { if (context.getDayCell().isDisabled()) { return false; } else { contextMenu.addItem("Simple day cell menu item", event -> {}); // do something return true; } } else { return false; } });
- Parameters:
contentMenuHandler
- handler to add
-
addItem
public FullCalendarMenuItem addItem(String text, com.vaadin.flow.component.ComponentEventListener<HasFullCalendarMenuItems.FullCalendarClickContextMenuItemEvent> clickListener) Description copied from interface:HasFullCalendarMenuItems
Adds new menu item.- Specified by:
addItem
in interfaceHasFullCalendarMenuItems
- Parameters:
text
- item's textclickListener
- click listener- Returns:
- added menu item
-
addItem
public FullCalendarMenuItem addItem(com.vaadin.flow.component.Component component, com.vaadin.flow.component.ComponentEventListener<HasFullCalendarMenuItems.FullCalendarClickContextMenuItemEvent> clickListener) Description copied from interface:HasFullCalendarMenuItems
Adds new menu item.- Specified by:
addItem
in interfaceHasFullCalendarMenuItems
- Parameters:
component
- component that should be used as a content of menu itemclickListener
- click listener- Returns:
- added menu item
-
setTarget
public void setTarget(@Nullable com.vaadin.flow.component.Component target) - Overrides:
setTarget
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,
FullCalendarMenuItem, FullCalendarSubMenu>
-
getTarget
- Overrides:
getTarget
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,
FullCalendarMenuItem, FullCalendarSubMenu>
-
onBeforeOpenMenu
protected boolean onBeforeOpenMenu(elemental.json.JsonObject eventDetail) - Overrides:
onBeforeOpenMenu
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,
FullCalendarMenuItem, FullCalendarSubMenu>
-
createMenuManager
protected com.vaadin.flow.component.contextmenu.MenuManager<FullCalendarContextMenu,FullCalendarMenuItem, createMenuManagerFullCalendarSubMenu> (com.vaadin.flow.function.SerializableRunnable contentReset) - Specified by:
createMenuManager
in classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,
FullCalendarMenuItem, FullCalendarSubMenu>
-