Class E4SelectionListener<T>
java.lang.Object
org.eclipse.nebula.widgets.nattable.extension.e4.selection.E4SelectionListener<T>
- Type Parameters:
T- The type of objects provided by theIRowDataProvider
- All Implemented Interfaces:
ILayerListener
Implementation of
ILayerListener to support E4 selection handling.
Needs to be set to the SelectionLayer
E4SelectionListener<Person> esl = new E4SelectionListener<>(service, selectionLayer, bodyDataProvider); selectionLayer.addLayerListener(esl);
-
Constructor Summary
ConstructorsConstructorDescriptionE4SelectionListener(org.eclipse.e4.ui.workbench.modeling.ESelectionService service, SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider) Create aE4SelectionListenerand registers it to the givenSelectionLayer. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleLayerEvent(ILayerEvent event) Handle an event notification from anILayerbooleanbooleanbooleanbooleanvoidsetFullySelectedRowsOnly(boolean fullySelectedRowsOnly) voidsetHandleSameRowSelection(boolean handleSameRowSelection) voidsetMultiSelection(boolean multiSelection) Set this value totrueif a list of values should be set as selection to theESelectionServiceorfalseif only a single value object should be set.voidsetProcessColumnSelection(boolean processColumnSelection) Configure whether column selections should start row selection processing or not.
-
Constructor Details
-
E4SelectionListener
@Inject public E4SelectionListener(org.eclipse.e4.ui.workbench.modeling.ESelectionService service, SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider) Create aE4SelectionListenerand registers it to the givenSelectionLayer.- Parameters:
service- TheESelectionServiceto which the selection should be published to.selectionLayer- TheSelectionLayerthat is used to retrieve the selection.rowDataProvider- TheIRowDataProviderto access the selected row data.
-
-
Method Details
-
handleLayerEvent
Description copied from interface:ILayerListenerHandle an event notification from anILayer- Specified by:
handleLayerEventin interfaceILayerListener- Parameters:
event- the event
-
isFullySelectedRowsOnly
public boolean isFullySelectedRowsOnly()- Returns:
trueif only fully selected rows should be used to populate the selection or if any selection should be populated. Default istrue.
-
setFullySelectedRowsOnly
public void setFullySelectedRowsOnly(boolean fullySelectedRowsOnly) - Parameters:
fullySelectedRowsOnly-trueif only fully selected rows should be used to populate the selectionfalseif any selection should be populated.
-
isHandleSameRowSelection
public boolean isHandleSameRowSelection()- Returns:
trueif a selection should only be handled by theESelectionServiceif the row selection changes or if just another column is selected.
-
setHandleSameRowSelection
public void setHandleSameRowSelection(boolean handleSameRowSelection) - Parameters:
handleSameRowSelection-trueif a selection should only be handled by theESelectionServiceif the row selection changes or if just another column is selected.
-
isProcessColumnSelection
public boolean isProcessColumnSelection()- Returns:
trueif column selection should trigger setting the selection viaESelectionService(that means basically a select all),falseif not (needed for huge datasets to avoid a select all).
-
setProcessColumnSelection
public void setProcessColumnSelection(boolean processColumnSelection) Configure whether column selections should start row selection processing or not.This is necessary to handle issues with huge datasets. Dependent on different configurations, selecting a column can cause the selection of all rows in a table, which would then lead to populate the whole dataset as selection via this provider. Setting the
processColumnSelectionflag tofalsewill skip processing to avoid such issues.- Parameters:
processColumnSelection-trueto process row selection in case of column selections (default)falseto skip processing in case of column selections to avoid issues on large datasets.
-
isMultiSelection
public boolean isMultiSelection()- Returns:
trueif a list of data values should be set as selection or a single value.
-
setMultiSelection
public void setMultiSelection(boolean multiSelection) Set this value totrueif a list of values should be set as selection to theESelectionServiceorfalseif only a single value object should be set.- Parameters:
multiSelection-trueif a list of data values should be set as selection or a single value.
-