Home Reference Source Test Repository
import ContextMenuListener from 'electron-spellchecker/src/context-menu-listener.js'
public class | source

ContextMenuListener

ContextMenuListener will listen to the given window / WebView control and invoke a handler function. This function usually will immediately turn around and invoke {{showPopupMenu}} from {{ContextMenuBuilder}}.

Static Method Summary

Static Public Methods
public static

Override the default logger for this class.

Constructor Summary

Public Constructor
public

constructor(handler: Function, windowOrWebView: BrowserWindow | WebView, contextMenuEvent: Observable<Object>)

Constructs a ContextMenuListener and wires up the events it needs to fire the callback.

Member Summary

Public Members
public

disp: *

Method Summary

Public Methods
public

Disconnect the events that we connected in the Constructor

Static Public Methods

public static setLogger(fn: Function) source

Override the default logger for this class. You probably want to use {{setGlobalLogger}} instead

Params:

NameTypeAttributeDescription
fn Function

The function which will operate like console.log

Public Constructors

public constructor(handler: Function, windowOrWebView: BrowserWindow | WebView, contextMenuEvent: Observable<Object>) source

Constructs a ContextMenuListener and wires up the events it needs to fire the callback.

Params:

NameTypeAttributeDescription
handler Function

The callback that will be invoked with the 'context-menu' info.

windowOrWebView BrowserWindow | WebView

The target, either a BrowserWindow or a WebView

contextMenuEvent Observable<Object>

Use this for simulating a ContextMenu event

Public Members

public disp: * source

Public Methods

public dispose() source

Disconnect the events that we connected in the Constructor