Search in sources :

Example 1 with ViewportSelectRowCommand

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)));
}
Also used : RowHeaderLayer(org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer) LabelStack(org.eclipse.nebula.widgets.nattable.layer.LabelStack) ViewportSelectRowCommand(org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectRowCommand) Test(org.junit.Test)

Aggregations

RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)1 LabelStack (org.eclipse.nebula.widgets.nattable.layer.LabelStack)1 ViewportSelectRowCommand (org.eclipse.nebula.widgets.nattable.viewport.command.ViewportSelectRowCommand)1 Test (org.junit.Test)1