@Test
  public void shouldFireCellSelectionEvent() throws Exception {
    // Grid coordinates
    this.nattable.doCommand(new SelectCellCommand(this.nattable, 1, 5, NO_SHIFT, NO_CTRL));

    assertEquals(1, this.listener.getEventsCount());
    assertTrue(this.listener.containsInstanceOf(CellSelectionEvent.class));

    CellSelectionEvent event = (CellSelectionEvent) this.listener.getReceivedEvents().get(0);
    assertEquals(1, event.getColumnPosition());
    assertEquals(5, event.getRowPosition());
  }
示例#2
0
 /**
  * Cell selection event.
  *
  * @param arg1
  */
 protected void actionCellSelected(CellSelectionEvent arg1) {
   if (model != null) {
     int column = arg1.getColumnPosition() - 1;
     if (column >= 0) actionColumnSelected(column);
   }
 }