|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.nebula.widgets.nattable.selection.SelectionModel
public class SelectionModel
Tracks the selections made in the table. All selections are tracked in terms of Rectangles. For example if the table has 10 rows and column 2 is selected, the Rectangle tracked is (0, 2, 10, 1) Coordinates are in Selection Layer positions
SelectionLayer
Constructor Summary | |
---|---|
SelectionModel(SelectionLayer selectionLayer)
|
|
SelectionModel(SelectionLayer selectionLayer,
boolean multipleSelectionAllowed)
|
Method Summary | |
---|---|
void |
addSelection(int columnPosition,
int rowPosition)
Selects a specified cell |
void |
addSelection(org.eclipse.swt.graphics.Rectangle range)
Selects the cells of a specified area |
void |
clearSelection()
Removes all cell selections |
void |
clearSelection(int columnPosition,
int rowPosition)
Deselects a specified cell |
void |
clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
Removes the selection of specified cells |
protected boolean |
contains(org.eclipse.swt.graphics.Rectangle containerRectangle,
org.eclipse.swt.graphics.Rectangle rectangle)
|
int[] |
getFullySelectedColumnPositions(int columnHeight)
|
int[] |
getFullySelectedRowPositions(int rowWidth)
|
int[] |
getSelectedColumnPositions()
Retrieves the columns that have any selected cells |
int |
getSelectedRowCount()
Retrieves the number of rows that have any selected cell |
Set<Range> |
getSelectedRowPositions()
Retrieves the rows with a valid row position that have any selected cells |
List<org.eclipse.swt.graphics.Rectangle> |
getSelections()
Retrieves the cells that are selected |
boolean |
isCellPositionSelected(int columnPosition,
int rowPosition)
Determines whether a specified cell is selected |
boolean |
isColumnPositionFullySelected(int columnPosition,
int columnHeight)
Are all cells in this column selected? Different selection rectangles might aggregate to cover the entire column. |
boolean |
isColumnPositionSelected(int columnPosition)
Determines whether a specified column contains any selected cell |
boolean |
isEmpty()
Determines whether there are any selected cells |
boolean |
isMultipleSelectionAllowed()
Determines whether multiple cells can be selected simultaneously |
boolean |
isRowPositionFullySelected(int rowPosition,
int rowWidth)
|
boolean |
isRowPositionSelected(int rowPosition)
Determines whether a specified row contains any selected cell |
void |
setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
Sets whether multiple cells can be selected simultaneously |
protected void |
sortByX(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInRow)
|
protected void |
sortByY(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInColumn)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SelectionModel(SelectionLayer selectionLayer)
public SelectionModel(SelectionLayer selectionLayer, boolean multipleSelectionAllowed)
Method Detail |
---|
public boolean isMultipleSelectionAllowed()
ISelectionModel
isMultipleSelectionAllowed
in interface ISelectionModel
public void setMultipleSelectionAllowed(boolean multipleSelectionAllowed)
ISelectionModel
setMultipleSelectionAllowed
in interface ISelectionModel
multipleSelectionAllowed
- whether multiple cells can be selected simultaneouslypublic void addSelection(int columnPosition, int rowPosition)
ISelectionModel
addSelection
in interface ISelectionModel
columnPosition
- column position of the cell to selectrowPosition
- row position of the cell to selectpublic void addSelection(org.eclipse.swt.graphics.Rectangle range)
ISelectionModel
addSelection
in interface ISelectionModel
range
- the position based area to selectpublic void clearSelection()
ISelectionModel
clearSelection
in interface ISelectionModel
public void clearSelection(int columnPosition, int rowPosition)
ISelectionModel
clearSelection
in interface ISelectionModel
columnPosition
- column position of the cell to deselectrowPosition
- row position of the cell to deselectpublic void clearSelection(org.eclipse.swt.graphics.Rectangle removedSelection)
ISelectionModel
clearSelection
in interface ISelectionModel
removedSelection
- the position based area to deselectpublic boolean isEmpty()
ISelectionModel
isEmpty
in interface ISelectionModel
public List<org.eclipse.swt.graphics.Rectangle> getSelections()
ISelectionModel
getSelections
in interface ISelectionModel
public boolean isCellPositionSelected(int columnPosition, int rowPosition)
ISelectionModel
isCellPositionSelected
in interface ISelectionModel
columnPosition
- column position of the cell to inspectrowPosition
- row position of the cell to inspect
public int[] getSelectedColumnPositions()
ISelectionModel
getSelectedColumnPositions
in interface ISelectionModel
public boolean isColumnPositionSelected(int columnPosition)
ISelectionModel
isColumnPositionSelected
in interface ISelectionModel
columnPosition
- column position to inspect
public int[] getFullySelectedColumnPositions(int columnHeight)
getFullySelectedColumnPositions
in interface ISelectionModel
columnHeight
- the number of rows in a fully selected columnpublic boolean isColumnPositionFullySelected(int columnPosition, int columnHeight)
isColumnPositionFullySelected
in interface ISelectionModel
columnHeight
- the number of rows in a fully selected columnpublic int getSelectedRowCount()
ISelectionModel
getSelectedRowCount
in interface ISelectionModel
public Set<Range> getSelectedRowPositions()
ISelectionModel
getSelectedRowPositions
in interface ISelectionModel
public boolean isRowPositionSelected(int rowPosition)
ISelectionModel
isRowPositionSelected
in interface ISelectionModel
rowPosition
- row position to inspect
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
protected boolean contains(org.eclipse.swt.graphics.Rectangle containerRectangle, org.eclipse.swt.graphics.Rectangle rectangle)
protected void sortByX(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInRow)
protected void sortByY(List<org.eclipse.swt.graphics.Rectangle> selectionRectanglesInColumn)
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |