@Test
  public void shouldFireColumnSelectionEvent() throws Exception {
    this.nattable.doCommand(new SelectColumnCommand(this.nattable, 5, 5, NO_SHIFT, NO_CTRL));

    assertEquals(2, this.listener.getEventsCount());
    assertTrue(this.listener.containsInstanceOf(ColumnSelectionEvent.class));
    assertTrue(this.listener.containsInstanceOf(ColumnHeaderSelectionEvent.class));

    ColumnSelectionEvent event = (ColumnSelectionEvent) this.listener.getReceivedEvents().get(0);
    assertEquals(5, event.getColumnPositionRanges().iterator().next().start);
    assertEquals(6, event.getColumnPositionRanges().iterator().next().end);
  }
Esempio n. 2
0
 /**
  * Column selection event.
  *
  * @param arg1
  */
 protected void actionColumnSelected(ColumnSelectionEvent arg1) {
   if (model != null) {
     int column = arg1.getColumnPositionRanges().iterator().next().start - 1;
     if (column >= 0) actionColumnSelected(column);
   }
 }