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 aE4SelectionListener
and registers it to the givenSelectionLayer
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
handleLayerEvent
(ILayerEvent event) Handle an event notification from anILayer
boolean
boolean
boolean
boolean
void
setFullySelectedRowsOnly
(boolean fullySelectedRowsOnly) void
setHandleSameRowSelection
(boolean handleSameRowSelection) void
setMultiSelection
(boolean multiSelection) Set this value totrue
if a list of values should be set as selection to theESelectionService
orfalse
if only a single value object should be set.void
setProcessColumnSelection
(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 aE4SelectionListener
and registers it to the givenSelectionLayer
.- Parameters:
service
- TheESelectionService
to which the selection should be published to.selectionLayer
- TheSelectionLayer
that is used to retrieve the selection.rowDataProvider
- TheIRowDataProvider
to access the selected row data.
-
-
Method Details
-
handleLayerEvent
Description copied from interface:ILayerListener
Handle an event notification from anILayer
- Specified by:
handleLayerEvent
in interfaceILayerListener
- Parameters:
event
- the event
-
isFullySelectedRowsOnly
public boolean isFullySelectedRowsOnly()- Returns:
true
if 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
-true
if only fully selected rows should be used to populate the selectionfalse
if any selection should be populated.
-
isHandleSameRowSelection
public boolean isHandleSameRowSelection()- Returns:
true
if a selection should only be handled by theESelectionService
if the row selection changes or if just another column is selected.
-
setHandleSameRowSelection
public void setHandleSameRowSelection(boolean handleSameRowSelection) - Parameters:
handleSameRowSelection
-true
if a selection should only be handled by theESelectionService
if the row selection changes or if just another column is selected.
-
isProcessColumnSelection
public boolean isProcessColumnSelection()- Returns:
true
if column selection should trigger setting the selection viaESelectionService
(that means basically a select all),false
if 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
processColumnSelection
flag tofalse
will skip processing to avoid such issues.- Parameters:
processColumnSelection
-true
to process row selection in case of column selections (default)false
to skip processing in case of column selections to avoid issues on large datasets.
-
isMultiSelection
public boolean isMultiSelection()- Returns:
true
if a list of data values should be set as selection or a single value.
-
setMultiSelection
public void setMultiSelection(boolean multiSelection) Set this value totrue
if a list of values should be set as selection to theESelectionService
orfalse
if only a single value object should be set.- Parameters:
multiSelection
-true
if a list of data values should be set as selection or a single value.
-