@Test public void testOnKeyUp() { int unicharCode = KeyboardEvent.Key.CONTROL.getUnicharCode(); tested.onKeyUp(unicharCode); ArgumentCaptor<KeyUpEvent> eventArgumentCaptor = ArgumentCaptor.forClass(KeyUpEvent.class); verify(keyUpEvent, times(1)).fire(eventArgumentCaptor.capture()); KeyUpEvent keyEvent = eventArgumentCaptor.getValue(); assertEquals(unicharCode, keyEvent.getKey().getUnicharCode()); }
void onKeyUp(final int unicodeChar) { final KeyboardEvent.Key key = getKey(unicodeChar); if (null != key) { keyUpEvent.fire(new KeyUpEvent(key)); } }
StunnerLienzoBoundsPanel implements LienzoPanel { void onKeyUp(final int unicodeChar) { final KeyboardEvent.Key key = getKey(unicodeChar); if (null != key) { keyUpEvent.fire(new KeyUpEvent(key)); } } }
StunnerLienzoBoundsPanel implements LienzoPanel { void onKeyUp(final int unicodeChar) { final KeyboardEvent.Key key = getKey(unicodeChar); if (null != key) { keyUpEvent.fire(new KeyUpEvent(key)); } } @Inject  StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                                    final Event<KeyDownEvent> keyDownEvent,
                                    final Event<KeyUpEvent> keyUpEvent,
                                    final Event<CanvasMouseDownEvent> mouseDownEvent,
                                    final Event<CanvasMouseUpEvent> mouseUpEvent);   StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                             final Event<KeyDownEvent> keyDownEvent,
                             final Event<KeyUpEvent> keyUpEvent,
                             final Event<CanvasMouseDownEvent> mouseDownEvent,
                             final Event<CanvasMouseUpEvent> mouseUpEvent,
                             final HandlerRegistrationImpl registration); }
StunnerLienzoBoundsPanel implements LienzoPanel { void onKeyUp(final int unicodeChar) { final KeyboardEvent.Key key = getKey(unicodeChar); if (null != key) { keyUpEvent.fire(new KeyUpEvent(key)); } } @Inject  StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                                    final Event<KeyDownEvent> keyDownEvent,
                                    final Event<KeyUpEvent> keyUpEvent,
                                    final Event<CanvasMouseDownEvent> mouseDownEvent,
                                    final Event<CanvasMouseUpEvent> mouseUpEvent);   StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                             final Event<KeyDownEvent> keyDownEvent,
                             final Event<KeyUpEvent> keyUpEvent,
                             final Event<CanvasMouseDownEvent> mouseDownEvent,
                             final Event<CanvasMouseUpEvent> mouseUpEvent,
                             final HandlerRegistrationImpl registration); StunnerLienzoBoundsPanel setPanelBuilder(final BiFunction<OptionalInt, OptionalInt, LienzoBoundsPanel> panelBuilder); @Override Widget asWidget(); @Override LienzoPanel show(final LienzoLayer layer); @Override LienzoPanel show(final LienzoLayer layer,
                            final int width,
                            final int height); HandlerRegistration register(final HandlerRegistration handler); @Override LienzoPanel focus(); @Override int getWidthPx(); @Override int getHeightPx(); @Override Bounds getLocationConstraints(); @Override LienzoPanel setPixelSize(final int wide,
                                    final int high); @Override void setBackgroundLayer(final Layer layer); void destroy(); @Override LienzoBoundsPanel getView(); }
StunnerLienzoBoundsPanel implements LienzoPanel { void onKeyUp(final int unicodeChar) { final KeyboardEvent.Key key = getKey(unicodeChar); if (null != key) { keyUpEvent.fire(new KeyUpEvent(key)); } } @Inject  StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                                    final Event<KeyDownEvent> keyDownEvent,
                                    final Event<KeyUpEvent> keyUpEvent,
                                    final Event<CanvasMouseDownEvent> mouseDownEvent,
                                    final Event<CanvasMouseUpEvent> mouseUpEvent);   StunnerLienzoBoundsPanel(final Event<KeyPressEvent> keyPressEvent,
                             final Event<KeyDownEvent> keyDownEvent,
                             final Event<KeyUpEvent> keyUpEvent,
                             final Event<CanvasMouseDownEvent> mouseDownEvent,
                             final Event<CanvasMouseUpEvent> mouseUpEvent,
                             final HandlerRegistrationImpl registration); StunnerLienzoBoundsPanel setPanelBuilder(final BiFunction<OptionalInt, OptionalInt, LienzoBoundsPanel> panelBuilder); @Override Widget asWidget(); @Override LienzoPanel show(final LienzoLayer layer); @Override LienzoPanel show(final LienzoLayer layer,
                            final int width,
                            final int height); HandlerRegistration register(final HandlerRegistration handler); @Override LienzoPanel focus(); @Override int getWidthPx(); @Override int getHeightPx(); @Override Bounds getLocationConstraints(); @Override LienzoPanel setPixelSize(final int wide,
                                    final int high); @Override void setBackgroundLayer(final Layer layer); void destroy(); @Override LienzoBoundsPanel getView();  }