Interface CefContextMenuHandler

  • All Known Implementing Classes:
    CefClient, CefContextMenuHandlerAdapter

    public interface CefContextMenuHandler
    Implement this interface to handle context menu events. The methods of this class will be called on the UI thread.
    • Method Detail

      • onBeforeContextMenu

        void onBeforeContextMenu​(CefBrowser browser,
                                 CefFrame frame,
                                 CefContextMenuParams params,
                                 CefMenuModel model)
        Called before a context menu is displayed.
        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

        boolean onContextMenuCommand​(CefBrowser browser,
                                     CefFrame frame,
                                     CefContextMenuParams params,
                                     int commandId,
                                     int eventFlags)
        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
        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

        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.
        Parameters:
        browser - The browser generating the event.
        frame - The corresponding frame. Instance only valid within the scope of this method.