use of org.eclipse.nebula.widgets.nattable.filterrow.command.ClearFilterCommand in project nebula.widgets.nattable by eclipse.
the class FilterRowDataLayer method doCommand.
@Override
public boolean doCommand(ILayerCommand command) {
boolean handled = false;
if (command instanceof ClearFilterCommand && command.convertToTargetLayer(this)) {
int columnPosition = ((ClearFilterCommand) command).getColumnPosition();
setDataValueByPosition(columnPosition, 0, null);
handled = true;
} else if (command instanceof ClearAllFiltersCommand) {
getFilterRowDataProvider().clearAllFilters();
handled = true;
}
if (handled) {
fireLayerEvent(new RowStructuralRefreshEvent(this));
return true;
} else {
return super.doCommand(command);
}
}
use of org.eclipse.nebula.widgets.nattable.filterrow.command.ClearFilterCommand in project nebula.widgets.nattable by eclipse.
the class ClearAllFiltersAction method run.
@Override
public void run(NatTable natTable, MouseEvent event) {
NatEventData natEventData = (NatEventData) event.data;
natTable.doCommand(new ClearFilterCommand(natTable, natEventData.getColumnPosition()));
}
use of org.eclipse.nebula.widgets.nattable.filterrow.command.ClearFilterCommand in project nebula.widgets.nattable by eclipse.
the class ClearFilterAction method run.
@Override
public void run(NatTable natTable, MouseEvent event) {
NatEventData natEventData = (NatEventData) event.data;
natTable.doCommand(new ClearFilterCommand(natTable, natEventData.getColumnPosition()));
}
use of org.eclipse.nebula.widgets.nattable.filterrow.command.ClearFilterCommand in project nebula.widgets.nattable by eclipse.
the class FilterRowHeaderCompositeTest method shouldHandleClearFilterCommand.
@Test
public void shouldHandleClearFilterCommand() throws Exception {
Assert.assertEquals(13, this.filterList.size());
this.layerUnderTest.doCommand(new UpdateDataCommand(this.layerUnderTest, 1, 2, "ford"));
Assert.assertEquals(1, this.filterList.size());
this.layerUnderTest.doCommand(new ClearFilterCommand(this.layerUnderTest, 1));
Assert.assertEquals(13, this.filterList.size());
this.listener.containsInstanceOf(RowStructuralRefreshEvent.class);
}
use of org.eclipse.nebula.widgets.nattable.filterrow.command.ClearFilterCommand in project nebula.widgets.nattable by eclipse.
the class FilterRowDataLayerTest method shouldHandleClearFilterCommand.
@Test
public void shouldHandleClearFilterCommand() throws Exception {
assertEquals(13, this.filterList.size());
this.layerUnderTest.doCommand(new UpdateDataCommand(this.layerUnderTest, 1, 0, "ford"));
assertEquals(1, this.filterList.size());
this.layerUnderTest.doCommand(new ClearFilterCommand(this.layerUnderTest, 1));
assertEquals(13, this.filterList.size());
this.listener.containsInstanceOf(RowStructuralRefreshEvent.class);
}
Aggregations