List of usage examples for com.google.gwt.coreext.client JsIntegerMap create
public static native <T> JsIntegerMap<T> create() ;
From source file:com.google.speedtracer.client.HotKey.java
License:Apache License
/** * Registers a handler to receive notification when the key corresponding to * {@code keyCode} is used.// w w w .ja v a2 s. co m * * Only one handler can be tied to a particular key code. Attempting to * register a previously registered code will result in an assertion being * raised. * * @param keyCode the key code to register * @param handler a callback handler * @param description short human readable description for the action. */ public static void register(int keyCode, Handler handler, String description) { if (handlers == null) { remover = addEventListeners(); handlers = JsIntegerMap.create(); } assert handlers.get(keyCode) == null; handlers.put(keyCode, new Data(keyCode, handler, description)); ++handlerCount; }
From source file:com.google.speedtracer.client.model.ChromeDebuggerDataInstance.java
License:Apache License
private static void ensureRecordRouter() { if (recordRouter == null) { recordRouter = JsIntegerMap.create(); Debugger.getEvent().addListener(new DebuggerEvent.Listener() { public void onEvent(Debuggee source, String method, RawDebuggerEventRecord params) { Proxy proxy = recordRouter.get(source.getTabId()); if (proxy == null) { // Some other extension must be debugging this. return; }/* ww w . j av a2s .co m*/ // Dispatch the event to this guy. proxy.dispatchDebuggerEventRecord(method, params); } }); } }