public class RowSelectionModel<R> extends Object implements IRowSelectionModel<R>
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
RowSelectionModel(SelectionLayer selectionLayer,
IRowDataProvider<R> rowDataProvider,
IRowIdAccessor<R> rowIdAccessor) |
RowSelectionModel(SelectionLayer selectionLayer,
IRowDataProvider<R> rowDataProvider,
IRowIdAccessor<R> rowIdAccessor,
boolean multipleSelectionAllowed) |
Modifier and Type | Method and Description |
---|---|
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) |
protected final SelectionLayer selectionLayer
protected final IRowDataProvider<R> rowDataProvider
protected final IRowIdAccessor<R> rowIdAccessor
protected Map<Serializable,R> selectedRows
protected org.eclipse.swt.graphics.Rectangle lastSelectedRange
protected Set<Serializable> lastSelectedRowIds
protected final ReadWriteLock selectionsLock
public RowSelectionModel(SelectionLayer selectionLayer, IRowDataProvider<R> rowDataProvider, IRowIdAccessor<R> rowIdAccessor)
public RowSelectionModel(SelectionLayer selectionLayer, IRowDataProvider<R> rowDataProvider, IRowIdAccessor<R> rowIdAccessor, boolean multipleSelectionAllowed)
public boolean isMultipleSelectionAllowed()
isMultipleSelectionAllowed
in interface ISelectionModel
public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
setMultipleSelectionAllowed
in interface ISelectionModel
public void addSelection(int columnPosition, int rowPosition)
addSelection
in interface ISelectionModel
public void addSelection(org.eclipse.swt.graphics.Rectangle range)
addSelection
in interface ISelectionModel
public void clearSelection()
clearSelection
in interface ISelectionModel
public void clearSelection(int columnPosition, int rowPosition)
clearSelection
in interface ISelectionModel
public void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
clearSelection
in interface ISelectionModel
public void clearSelection(R rowObject)
IRowSelectionModel
clearSelection
in interface IRowSelectionModel<R>
public boolean isEmpty()
isEmpty
in interface ISelectionModel
public List<org.eclipse.swt.graphics.Rectangle> getSelections()
getSelections
in interface ISelectionModel
public boolean isCellPositionSelected(int columnPosition, int rowPosition)
isCellPositionSelected
in interface ISelectionModel
public int[] getSelectedColumnPositions()
getSelectedColumnPositions
in interface ISelectionModel
public boolean isColumnPositionSelected(int columnPosition)
isColumnPositionSelected
in interface ISelectionModel
public int[] getFullySelectedColumnPositions(int fullySelectedColumnRowCount)
getFullySelectedColumnPositions
in interface ISelectionModel
fullySelectedColumnRowCount
- the number of rows in a fully selected columnpublic boolean isColumnPositionFullySelected(int columnPosition, int fullySelectedColumnRowCount)
isColumnPositionFullySelected
in interface ISelectionModel
fullySelectedColumnRowCount
- the number of rows in a fully selected columnpublic List<R> getSelectedRowObjects()
IRowSelectionModel
getSelectedRowObjects
in interface IRowSelectionModel<R>
public int getSelectedRowCount()
getSelectedRowCount
in interface ISelectionModel
public Set<Range> getSelectedRowPositions()
getSelectedRowPositions
in interface ISelectionModel
public boolean isRowPositionSelected(int rowPosition)
isRowPositionSelected
in interface ISelectionModel
public int[] getFullySelectedRowPositions(int rowWidth)
getFullySelectedRowPositions
in interface ISelectionModel
rowWidth
- the number of columns in a fully selected rowpublic boolean isRowPositionFullySelected(int rowPosition, int rowWidth)
isRowPositionFullySelected
in interface ISelectionModel
Copyright © 2013. All Rights Reserved.