Package org.cef.handler
Class CefContextMenuHandlerAdapter
- java.lang.Object
-
- org.cef.handler.CefContextMenuHandlerAdapter
-
- All Implemented Interfaces:
CefContextMenuHandler
public abstract class CefContextMenuHandlerAdapter extends java.lang.Object implements CefContextMenuHandler
An abstract adapter class for receiving context menu events. The methods in this class are empty. This class exists as convenience for creating handler objects.
-
-
Constructor Summary
Constructors Constructor Description CefContextMenuHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model)
Called before a context menu is displayed.boolean
onContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams params, int commandId, int eventFlags)
Called to execute a command selected from the context menu.void
onContextMenuDismissed(CefBrowser browser, CefFrame frame)
Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.
-
-
-
Method Detail
-
onBeforeContextMenu
public void onBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams params, CefMenuModel model)
Description copied from interface:CefContextMenuHandler
Called before a context menu is displayed.- Specified by:
onBeforeContextMenu
in interfaceCefContextMenuHandler
- Parameters:
browser
- The browser generating the event.frame
- The frame generating the event. Instance only valid within the scope of this method.params
- Provides information about the context menu state. Instance only valid within the scope of this method.model
- Can be cleared to show no context menu or modified to show a custom menu. Instance only valid within the scope of this method.
-
onContextMenuCommand
public boolean onContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams params, int commandId, int eventFlags)
Description copied from interface:CefContextMenuHandler
Called to execute a command selected from the context menu. Return true if the command was handled or false for the default implementation. See cef_menu_id_t for the command ids that have default implementations. All user-defined command ids should be between MENU_ID_USER_FIRST and- Specified by:
onContextMenuCommand
in interfaceCefContextMenuHandler
- Parameters:
browser
- The browser generating the event.frame
- The frame generating the event. Instance only valid within the scope of this method.params
- Will have the same values that were passed to onBeforeContextMenu(). Instance only valid within the scope of this method.commandId
- The id of the command.eventFlags
- A combination of event flags defined in EventFlags- Returns:
- true if the command was handled or false for the default implementation.
-
onContextMenuDismissed
public void onContextMenuDismissed(CefBrowser browser, CefFrame frame)
Description copied from interface:CefContextMenuHandler
Called when the context menu is dismissed irregardless of whether the menu was empty or a command was selected.- Specified by:
onContextMenuDismissed
in interfaceCefContextMenuHandler
- Parameters:
browser
- The browser generating the event.frame
- The corresponding frame. Instance only valid within the scope of this method.
-
-