getColumnLabel(columnHeaderLayer, getDataLayer(), 1));
}
@Test
public void getVisibleColumnEntries() throws Exception {
DefaultGridLayer gridLayer = new DefaultGridLayer(
RowDataListFixture.getList(),
RowDataListFixture.getPropertyNames(),
RowDataListFixture.getPropertyToLabelMap());
ColumnHideShowLayer columnHideShowLayer = gridLayer.getBodyLayer()
.getColumnHideShowLayer();
ColumnHeaderLayer columnHeaderLayer = gridLayer.getColumnHeaderLayer();
DataLayer columnHeaderDataLayer = (DataLayer) gridLayer
.getColumnHeaderDataLayer();
List<ColumnEntry> visibleEntries = ColumnChooserUtils
.getVisibleColumnsEntries(columnHideShowLayer,
columnHeaderLayer, columnHeaderDataLayer);
// All columns shown
assertEquals(RowDataListFixture.getPropertyNames().length,
visibleEntries.size());
// Hide a few columns
gridLayer.getBodyLayer().getColumnHideShowLayer()
.hideColumnPositions(Arrays.asList(1, 2, 3));
visibleEntries = ColumnChooserUtils.getVisibleColumnsEntries(
columnHideShowLayer, columnHeaderLayer, columnHeaderDataLayer);
assertEquals(RowDataListFixture.getPropertyNames().length - 3,
visibleEntries.size());