コード例 #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());
  }
コード例 #3
0
 @Before
 public void setUp() {
   assumeTrue(TestUtil.notHeadless());
   root = new FakeScene();
   panel = new MockTextInputPanel();
   parent = new PropPanel(new FakePropProxy());
   parent.add(panel);
   root.add(parent);
   stage = new MockStage();
   root.setStage(stage);
   model = panel.getModel();
   model.setText("Some Text");
 }