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 the IRowDataProvider
All Implemented Interfaces:
ILayerListener

public class E4SelectionListener<T> extends Object implements 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 Details

    • E4SelectionListener

      @Inject public E4SelectionListener(org.eclipse.e4.ui.workbench.modeling.ESelectionService service, SelectionLayer selectionLayer, IRowDataProvider<T> rowDataProvider)
      Create a E4SelectionListener and registers it to the given SelectionLayer.
      Parameters:
      service - The ESelectionService to which the selection should be published to.
      selectionLayer - The SelectionLayer that is used to retrieve the selection.
      rowDataProvider - The IRowDataProvider to access the selected row data.
  • Method Details

    • handleLayerEvent

      public void handleLayerEvent(ILayerEvent event)
      Description copied from interface: ILayerListener
      Handle an event notification from an ILayer
      Specified by:
      handleLayerEvent in interface ILayerListener
      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 is true.
    • setFullySelectedRowsOnly

      public void setFullySelectedRowsOnly(boolean fullySelectedRowsOnly)
      Parameters:
      fullySelectedRowsOnly - true if only fully selected rows should be used to populate the selection false if any selection should be populated.
    • isHandleSameRowSelection

      public boolean isHandleSameRowSelection()
      Returns:
      true if a selection should only be handled by the ESelectionService 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 the ESelectionService 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 via ESelectionService (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 to false 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 to true if a list of values should be set as selection to the ESelectionService or false 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.