Interface Sidebar.SetupMenuCallback
- All Superinterfaces:
FunctionPointer
- Enclosing class:
Sidebar
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Functional interface declaration of the SetupMenuCallback callback.
- Since:
- 1.9
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidrun(@Nullable SidebarItem item) Emitted when a context menu is opened or closed foritem.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.default voidupcall(MemorySegment sourceSidebar, MemorySegment item) Theupcallmethod is called from native code.
-
Method Details
-
run
Emitted when a context menu is opened or closed for
item.If the menu has been closed,
itemwill be set toNULL.It can be used to set up menu actions before showing the menu, for example disable actions not applicable to
item. -
upcall
Theupcallmethod is called from native code. The parameters are marshaled andrun(SidebarItem)is executed. -
toCallback
Creates a native function pointer to theupcall(MemorySegment, MemorySegment)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-