use of org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectRowCommand in project nebula.widgets.nattable by eclipse.
the class RowHeaderSelectionTest method shouldReturnFullySelectedStyle.
@Test
public void shouldReturnFullySelectedStyle() {
// Select full column
this.gridLayer.doCommand(new ViewportSelectRowCommand(this.gridLayer, 1, false, false));
RowHeaderLayer rowHeaderLayer = (RowHeaderLayer) this.gridLayer.getChildLayerByLayoutCoordinate(0, 1);
// Since I selected using grid coordinates, the column position should
// be 1 rather than 2
int rowPosition = this.gridLayer.localToUnderlyingRowPosition(1);
final LabelStack labelStack = rowHeaderLayer.getConfigLabelsByPosition(rowPosition, 0);
Assert.assertTrue(labelStack.hasLabel(SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE));
rowPosition = this.gridLayer.localToUnderlyingRowPosition(4);
Assert.assertFalse("Should not have returned fully selected style.", SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE.equals(rowHeaderLayer.getConfigLabelsByPosition(0, rowPosition)));
}
Aggregations