Search in sources :

Example 1 with SelectionStyleConfiguration

use of org.eclipse.nebula.widgets.nattable.extension.builder.configuration.SelectionStyleConfiguration in project nebula.widgets.nattable by eclipse.

the class NatTableBuilder method configureSelectionStyle.

/**
 * Set up selection behavior. Select cells vs select rows.
 */
protected void configureSelectionStyle() {
    SelectionLayer selectionLayer = bodyLayer.getSelectionLayer();
    if (tableModel.enableFullRowSelection) {
        selectionLayer.addConfiguration(new RowOnlySelectionConfiguration<T>());
        natTable.addConfiguration(new RowSelectionUIBindings());
        selectionLayer.setSelectionModel(new RowSelectionModel<T>(selectionLayer, bodyLayer.getDataProvider(), rowIdAccessor));
    } else {
        selectionLayer.addConfiguration(new DefaultSelectionLayerConfiguration());
    }
    natTable.addConfiguration(new SelectionStyleConfiguration(tableStyle));
}
Also used : SelectionLayer(org.eclipse.nebula.widgets.nattable.selection.SelectionLayer) RowSelectionUIBindings(org.eclipse.nebula.widgets.nattable.extension.builder.configuration.RowSelectionUIBindings) SelectionStyleConfiguration(org.eclipse.nebula.widgets.nattable.extension.builder.configuration.SelectionStyleConfiguration) DefaultSelectionLayerConfiguration(org.eclipse.nebula.widgets.nattable.selection.config.DefaultSelectionLayerConfiguration)

Aggregations

RowSelectionUIBindings (org.eclipse.nebula.widgets.nattable.extension.builder.configuration.RowSelectionUIBindings)1 SelectionStyleConfiguration (org.eclipse.nebula.widgets.nattable.extension.builder.configuration.SelectionStyleConfiguration)1 SelectionLayer (org.eclipse.nebula.widgets.nattable.selection.SelectionLayer)1 DefaultSelectionLayerConfiguration (org.eclipse.nebula.widgets.nattable.selection.config.DefaultSelectionLayerConfiguration)1