use of org.eclipse.nebula.widgets.nattable.config.NullComparator in project nebula.widgets.nattable by eclipse.
the class SortIntegrationTest method shouldNotSortUnsortableColumns.
@Test
public void shouldNotSortUnsortableColumns() {
assertColumn2BeforeSort();
// Register custom label on column 2 (index 1)
DataLayer colHeaderDataLayer = this.gridLayerStack.getColumnHeaderDataLayer();
this.nattable.registerLabelOnColumnHeader(colHeaderDataLayer, 1, TEST_LABEL);
// Disable sorting on column 2 - null comparator
this.nattable.getConfigRegistry().registerConfigAttribute(SortConfigAttributes.SORT_COMPARATOR, new NullComparator(), DisplayMode.NORMAL, TEST_LABEL);
altClickColumn2Header();
// Assert no sort icon is displayed
List<String> labels = this.nattable.getConfigLabelsByPosition(2, 0).getLabels();
assertEquals(2, labels.size());
assertTrue(labels.contains("COLUMN_HEADER"));
assertTrue(labels.contains(TEST_LABEL));
assertColumn2BeforeSort();
}
Aggregations