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
FieldsModifier and TypeFieldDescriptionprotected FullCalendarCellContextprotected Function<FullCalendarCellContext,Boolean> protected FullCalendarDeserializerFields inherited from class com.vaadin.flow.component.contextmenu.ContextMenuBase
EVENT_DETAIL -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddContextMenuOpenedListener(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 FullCalendarContextMenucreate(FullCalendar target) Creates new instance of context menu with providedFullCalendartarget.protected com.vaadin.flow.component.contextmenu.MenuManager<FullCalendarContextMenu,FullCalendarMenuItem, FullCalendarSubMenu> createMenuManager(com.vaadin.flow.function.SerializableRunnable contentReset) protected booleanonBeforeOpenMenu(elemental.json.JsonObject eventDetail) voidsetContentMenuHandler(Function<FullCalendarCellContext, Boolean> contentMenuHandler) Sets a handler to configure content of context menu.voidsetTarget(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, setOpenOnClickMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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 providedFullCalendartarget.- 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:HasFullCalendarMenuItemsAdds new menu item.- Specified by:
addItemin 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:HasFullCalendarMenuItemsAdds new menu item.- Specified by:
addItemin 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:
setTargetin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,FullCalendarMenuItem, FullCalendarSubMenu>
-
getTarget
- Overrides:
getTargetin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,FullCalendarMenuItem, FullCalendarSubMenu>
-
onBeforeOpenMenu
protected boolean onBeforeOpenMenu(elemental.json.JsonObject eventDetail) - Overrides:
onBeforeOpenMenuin 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:
createMenuManagerin classcom.vaadin.flow.component.contextmenu.ContextMenuBase<FullCalendarContextMenu,FullCalendarMenuItem, FullCalendarSubMenu>
-