public class Selection
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
add(int column,
int row)
Adds the cell at the specified coordinates to the selection.
|
void |
add(int column1,
int row1,
int column2,
int row2)
Adds the range of cells at the specified coordinates to the selection.
|
void |
addColumns(int index)
Adds the column with the specified index to the selection.
|
void |
addColumns(int index,
int count)
Adds a range of columns to the selection.
|
void |
addObject(InteractiveObject obj)
Selects the specified object.
|
void |
addRows(int index)
Adds the row with the specified index to the selection.
|
void |
addRows(int index,
int count)
Adds a range of rows to the selection.
|
void |
addSelectionListener(SelectionListener listener)
Registers listener so that it will receive events from the selection.
|
void |
change(InteractiveObject obj)
Selects the specified object, deselects all other currently selected objects.
|
void |
clear()
Clears the selection.
|
void |
clearObjects()
Removes all interactive objects from the selection.
|
boolean |
contains(int column,
int row)
Checks whether the selection contains the cell at the specified coordinates.
|
boolean |
containsObject(InteractiveObject obj)
Checks whether the specified object is contained in the selection.
|
java.lang.Iterable<CellRange> |
getAllRanges()
Gets an enumerable with all selected cell ranges.
|
int |
getBottom()
Gets the index of the bottommost column of the selected cell range.
|
int |
getLeft()
Gets the index of the leftmost column of the selected cell range.
|
java.util.List<InteractiveObject> |
getObjects()
Gets a list with the selected objects.
|
CellRange |
getRange()
Gets a
CellRange object representing the selected range of cells,
or null, if the selection is empty. |
int |
getRight()
Gets the index of the rightmost column of the selected cell range.
|
int |
getTop()
Gets the index of the topmost column of the selected cell range.
|
boolean |
inColumn(int column)
Checks whether the specified column is part of the selection.
|
boolean |
inRow(int row)
Indicates whether the specified row is part of the selection.
|
boolean |
isEmpty()
Gets a value indicating whether the selection contains any cells.
|
void |
removeObject(InteractiveObject obj)
Removes the specified object from the selection.
|
void |
removeSelectionListener(SelectionListener listener)
Unregisters listener so that it will no longer receive selection events.
|
void |
selectAll()
Selects all cells in the worksheet.
|
void |
selectAll(int columns,
int rows)
Selects all cells starting from the topmost cell in a worksheet to the specified count of columns and rows.
|
void |
selectColumns(int index)
Selects the column with the specified index.
|
void |
selectColumns(int index,
int count)
Selects a range of columns in the worksheet.
|
void |
selectRows(int index)
Selects the row with the specified index.
|
void |
selectRows(int index,
int count)
Selects a range of rows in the worksheet.
|
void |
set(CellRange cellRange)
Sets the selection over the cells in the specified range.
|
void |
set(int column,
int row)
Sets the selection over the cell at the specified coordinates.
|
void |
set(int column1,
int row1,
int column2,
int row2)
Sets the selection over the range of cells at the specified coordinates.
|
void |
toggle(InteractiveObject obj)
Toggles the selection state of the specified object.
|
public void addSelectionListener(SelectionListener listener)
listener - An object implementing the SelectionListener interface.public void removeSelectionListener(SelectionListener listener)
listener - An object implementing the SelectionListener interface.public void set(int column,
int row)
column - The zero-based index of the column of the cell to select.row - The zero-based index of the row of the cell to select.public void set(CellRange cellRange)
cellRange - A CellRange object specifying the cells to select.public void set(int column1,
int row1,
int column2,
int row2)
column1 - The leftmost column of the range to select.row1 - The topmost row of the range to select.column2 - The rightmost column of the range to select.row2 - The bottommost row of the range to select.public void add(int column,
int row)
column - The zero-based index of the column of the cell to select.row - The zero-based index of the row of the cell to select.public void add(int column1,
int row1,
int column2,
int row2)
column1 - The leftmost column of the range to select.row1 - The topmost row of the range to select.column2 - The rightmost column of the range to select.row2 - The bottommost row of the range to select.public void addRows(int index)
index - The index of the row to add.public void addRows(int index,
int count)
index - The index of the first rows in the range.count - The number of rows to add.public void addColumns(int index)
index - The index of the column to add.public void addColumns(int index,
int count)
index - The index of the first columns in the range.count - The number of columns to add.public void selectAll()
public void selectAll(int columns,
int rows)
public void selectColumns(int index)
index - The index of the column to select.public void selectColumns(int index,
int count)
index - The index of the first column in the range.count - The number of columns to select.public void selectRows(int index)
index - The index of the row to select.public void selectRows(int index,
int count)
index - The index of the first rows in the range.count - The number of rows to select.public void clear()
public void clearObjects()
public boolean inRow(int row)
row - The row to test.true if at least one cell in the row is selected; otherwise, false.public boolean inColumn(int column)
column - The column to test.true if at least one cell in the column is selected; otherwise, false.public boolean contains(int column,
int row)
true if the selection contains the cell
at the specified coordinates; otherwise, false.public boolean containsObject(InteractiveObject obj)
obj - The object to check.true if the object is selected; otherwise, false.public void addObject(InteractiveObject obj)
obj - The object to select.public void change(InteractiveObject obj)
obj - The object to select.public void toggle(InteractiveObject obj)
obj - The object to select or deselect.public void removeObject(InteractiveObject obj)
obj - The object to deselect.public boolean isEmpty()
This property should return true only when the associated view does not display any worksheets. Otherwise the selection contains at least the currently active cell.
public java.lang.Iterable<CellRange> getAllRanges()
public CellRange getRange()
CellRange object representing the selected range of cells,
or null, if the selection is empty.
If there is more than one selected cell range, this property returns the first range.
public int getLeft()
public int getTop()
public int getRight()
public int getBottom()
public java.util.List<InteractiveObject> getObjects()
Do not modify the returned list directly. To select or deselect objects use the respective methods
of the Selection class - addObject(com.mindfusion.spreadsheet.InteractiveObject) and removeObject(com.mindfusion.spreadsheet.InteractiveObject).