org.eclipse.nebula.widgets.nattable.selection
Class RowSelectionModel<R>

java.lang.Object
  extended by org.eclipse.nebula.widgets.nattable.selection.RowSelectionModel<R>
All Implemented Interfaces:
IRowSelectionModel<R>, ISelectionModel

public class RowSelectionModel<R>
extends Object
implements IRowSelectionModel<R>


Field Summary
protected  org.eclipse.swt.graphics.Rectangle lastSelectedRange
           
protected  Set<Serializable> lastSelectedRowIds
           
protected  IRowDataProvider<R> rowDataProvider
           
protected  IRowIdAccessor<R> rowIdAccessor
           
protected  Map<Serializable,R> selectedRows
           
protected  SelectionLayer selectionLayer
           
protected  ReadWriteLock selectionsLock
           
 
Constructor Summary
RowSelectionModel(SelectionLayer selectionLayer, IRowDataProvider<R> rowDataProvider, IRowIdAccessor<R> rowIdAccessor)
           
RowSelectionModel(SelectionLayer selectionLayer, IRowDataProvider<R> rowDataProvider, IRowIdAccessor<R> rowIdAccessor, boolean multipleSelectionAllowed)
           
 
Method Summary
 void addSelection(int columnPosition, int rowPosition)
           
 void addSelection(org.eclipse.swt.graphics.Rectangle range)
           
 void clearSelection()
           
 void clearSelection(int columnPosition, int rowPosition)
           
 void clearSelection(R rowObject)
          Removes the selected row object from the selection
 void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
           
 int[] getFullySelectedColumnPositions(int fullySelectedColumnRowCount)
           
 int[] getFullySelectedRowPositions(int rowWidth)
           
 int[] getSelectedColumnPositions()
           
 int getSelectedRowCount()
           
 List<R> getSelectedRowObjects()
          Expose the underlying row objects
 Set<Range> getSelectedRowPositions()
           
 List<org.eclipse.swt.graphics.Rectangle> getSelections()
           
 boolean isCellPositionSelected(int columnPosition, int rowPosition)
           
 boolean isColumnPositionFullySelected(int columnPosition, int fullySelectedColumnRowCount)
           
 boolean isColumnPositionSelected(int columnPosition)
           
 boolean isEmpty()
           
 boolean isMultipleSelectionAllowed()
           
 boolean isRowPositionFullySelected(int rowPosition, int rowWidth)
           
 boolean isRowPositionSelected(int rowPosition)
           
 void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

selectionLayer

protected final SelectionLayer selectionLayer

rowDataProvider

protected final IRowDataProvider<R> rowDataProvider

rowIdAccessor

protected final IRowIdAccessor<R> rowIdAccessor

selectedRows

protected Map<Serializable,R> selectedRows

lastSelectedRange

protected org.eclipse.swt.graphics.Rectangle lastSelectedRange

lastSelectedRowIds

protected Set<Serializable> lastSelectedRowIds

selectionsLock

protected final ReadWriteLock selectionsLock
Constructor Detail

RowSelectionModel

public RowSelectionModel(SelectionLayer selectionLayer,
                         IRowDataProvider<R> rowDataProvider,
                         IRowIdAccessor<R> rowIdAccessor)

RowSelectionModel

public RowSelectionModel(SelectionLayer selectionLayer,
                         IRowDataProvider<R> rowDataProvider,
                         IRowIdAccessor<R> rowIdAccessor,
                         boolean multipleSelectionAllowed)
Method Detail

isMultipleSelectionAllowed

public boolean isMultipleSelectionAllowed()
Specified by:
isMultipleSelectionAllowed in interface ISelectionModel

setMultipleSelectionAllowed

public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
Specified by:
setMultipleSelectionAllowed in interface ISelectionModel

addSelection

public void addSelection(int columnPosition,
                         int rowPosition)
Specified by:
addSelection in interface ISelectionModel

addSelection

public void addSelection(org.eclipse.swt.graphics.Rectangle range)
Specified by:
addSelection in interface ISelectionModel

clearSelection

public void clearSelection()
Specified by:
clearSelection in interface ISelectionModel

clearSelection

public void clearSelection(int columnPosition,
                           int rowPosition)
Specified by:
clearSelection in interface ISelectionModel

clearSelection

public void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
Specified by:
clearSelection in interface ISelectionModel

clearSelection

public void clearSelection(R rowObject)
Description copied from interface: IRowSelectionModel
Removes the selected row object from the selection

Specified by:
clearSelection in interface IRowSelectionModel<R>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface ISelectionModel

getSelections

public List<org.eclipse.swt.graphics.Rectangle> getSelections()
Specified by:
getSelections in interface ISelectionModel

isCellPositionSelected

public boolean isCellPositionSelected(int columnPosition,
                                      int rowPosition)
Specified by:
isCellPositionSelected in interface ISelectionModel

getSelectedColumnPositions

public int[] getSelectedColumnPositions()
Specified by:
getSelectedColumnPositions in interface ISelectionModel

isColumnPositionSelected

public boolean isColumnPositionSelected(int columnPosition)
Specified by:
isColumnPositionSelected in interface ISelectionModel

getFullySelectedColumnPositions

public int[] getFullySelectedColumnPositions(int fullySelectedColumnRowCount)
Specified by:
getFullySelectedColumnPositions in interface ISelectionModel
Parameters:
fullySelectedColumnRowCount - the number of rows in a fully selected column

isColumnPositionFullySelected

public boolean isColumnPositionFullySelected(int columnPosition,
                                             int fullySelectedColumnRowCount)
Specified by:
isColumnPositionFullySelected in interface ISelectionModel
fullySelectedColumnRowCount - the number of rows in a fully selected column

getSelectedRowObjects

public List<R> getSelectedRowObjects()
Description copied from interface: IRowSelectionModel
Expose the underlying row objects

Specified by:
getSelectedRowObjects in interface IRowSelectionModel<R>
Returns:
The selected row objects.

getSelectedRowCount

public int getSelectedRowCount()
Specified by:
getSelectedRowCount in interface ISelectionModel

getSelectedRowPositions

public Set<Range> getSelectedRowPositions()
Specified by:
getSelectedRowPositions in interface ISelectionModel

isRowPositionSelected

public boolean isRowPositionSelected(int rowPosition)
Specified by:
isRowPositionSelected in interface ISelectionModel

getFullySelectedRowPositions

public int[] getFullySelectedRowPositions(int rowWidth)
Specified by:
getFullySelectedRowPositions in interface ISelectionModel
Parameters:
rowWidth - the number of columns in a fully selected row

isRowPositionFullySelected

public boolean isRowPositionFullySelected(int rowPosition,
                                          int rowWidth)
Specified by:
isRowPositionFullySelected in interface ISelectionModel


Copyright © 2014. All rights reserved.