Ejemplo n.º 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());
  }
Ejemplo n.º 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());
  }