Search in sources :

Example 1 with ViewportSelectColumnCommand

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

Aggregations

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