use of org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectColumnCommand in project nebula.widgets.nattable by eclipse.
the class ColumnHeaderLayerSelectionTest method shouldReturnFullySelectedStyle.
@Test
public void shouldReturnFullySelectedStyle() {
// Select full column
this.gridLayer.doCommand(new ViewportSelectColumnCommand(this.gridLayer, 2, false, false));
ColumnHeaderLayer columnHeaderLayer = (ColumnHeaderLayer) this.gridLayer.getChildLayerByLayoutCoordinate(1, 0);
// Since I selected using grid coordinates, the column position should
// be 1 rather than 2
int columnPosition = this.gridLayer.localToUnderlyingColumnPosition(2);
final LabelStack labelStack = columnHeaderLayer.getConfigLabelsByPosition(columnPosition, 0);
assertTrue(labelStack.hasLabel(SelectionStyleLabels.COLUMN_FULLY_SELECTED_STYLE));
columnPosition = this.gridLayer.localToUnderlyingColumnPosition(3);
assertFalse(SelectionStyleLabels.COLUMN_FULLY_SELECTED_STYLE.equals(labelStack));
}
Aggregations