コード例 #1
0
  @Test
  public void consumedCharTypedEventsDoNothing() throws Exception {
    panel = new TextBoxPanel();
    root.add(panel);
    panel.getModel().setText("Some Text");
    new CharTypedEvent(0, 'A').consumed().dispatch(panel);

    assertEquals("Some Text", panel.getText());
  }
コード例 #2
0
  @Test
  public void consumedKeyPressEventsDoNothing() throws Exception {
    panel = new TextBoxPanel();
    root.add(panel);
    panel.getModel().setText("Some Text");
    new KeyPressedEvent(0, KeyEvent.KEY_BACK_SPACE, 0).consumed().dispatch(panel);

    assertEquals("Some Text", panel.getText());
  }