Class TableView.Selection
java.lang.Object
overit.geocall.basic.ui.container.TableView.Selection
- All Implemented Interfaces:
Serializable
- Enclosing class:
TableView
Implements the object that manages the selections on the table
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a Selection object based on the column name passed as parameterCreates a Selection object based on the column name passed as firste parameter and the ordered set containing the reference of the selected rows passed as second parameter -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(int[] rows) Adds the rows to the selectionbooleanadd(int fromRow, int toRow) Adds to the selection the rows included in a rangebooleanAdd the selection passed as parameter to the current selectionbooleancontains(int row) Checks if the row is in the selectionbooleanempty()It subtructs the DBView record identifiers from the selectionbooleanfill()It adds the DBView record identifiers to the selectionReturn the content of the selectionGet the master element between the selected ones.intReturns the position of the column used to selectgetRows()Return an ArrayList containing the row's indexes of the selected rows.getSet()Returns the set containing the reference of the selected rowsbooleanisSet()Checks if the selection is a setbooleanremove(int[] rows) Removes the rows from the selectionbooleanremove(int fromRow, int toRow) Removes from the selection the rows included in a rangevoidsetupMetaData(DBView dbv) Called to setup the Selection, it sets the value of the position of the column used to selectintsize()Return the number of the currently selected rows of the table
-
Constructor Details
-
Selection
Creates a Selection object based on the column name passed as parameter- Parameters:
columnName- The string that represents the column name
-
Selection
Creates a Selection object based on the column name passed as firste parameter and the ordered set containing the reference of the selected rows passed as second parameter- Parameters:
columnName- The string that represents the column nameset- Ordered set containing the reference of the selected rows. It can be null
-
-
Method Details
-
setupMetaData
Called to setup the Selection, it sets the value of the position of the column used to select- Parameters:
dbv- The DBView containing the value of the position of the column used to select
-
isSet
public boolean isSet()Checks if the selection is a set- Returns:
- true is the selection is a set, false otherwise
-
getSet
Returns the set containing the reference of the selected rows- Returns:
- The set of selected rows
-
getPosition
public int getPosition()Returns the position of the column used to select- Returns:
- The number that defines the position of the column
-
size
public int size()Return the number of the currently selected rows of the table- Returns:
- The number of the currently selected rows
-
empty
public boolean empty()It subtructs the DBView record identifiers from the selection- Returns:
- true if the selection changes, false otherwise
-
fill
public boolean fill()It adds the DBView record identifiers to the selection- Returns:
- true if the selection changes, false otherwise
-
add
public boolean add(int[] rows) Adds the rows to the selection- Parameters:
rows- The array that contains the number of the rows to be added- Returns:
- true if something is changed in the selection, false otherwise
-
add
public boolean add(int fromRow, int toRow) Adds to the selection the rows included in a range- Parameters:
fromRow- The number of the first row of the rangetoRow- The number of the last row of the range- Returns:
- true if something is changed in the selection, false otherwise
-
remove
public boolean remove(int[] rows) Removes the rows from the selection- Parameters:
rows- The array that contains the number of the rows to be removed- Returns:
- true if something is changed in the selection, false otherwise
-
remove
public boolean remove(int fromRow, int toRow) Removes from the selection the rows included in a range- Parameters:
fromRow- The number of the first row of the rangetoRow- The number of the last row of the range- Returns:
- true if something is changed in the selection, false otherwise
-
add
Add the selection passed as parameter to the current selection- Parameters:
s- The selection to be added- Returns:
- true if something is changed in the selection, false otherwise
-
contains
public boolean contains(int row) Checks if the row is in the selection- Parameters:
row- The number that identifies the row- Returns:
- true if the row is currently selected, false otherwise
-
getContent
Return the content of the selection- Returns:
- The ArrayList containing the HashGetters of the selected rows, or null
-
getMaster
Get the master element between the selected ones. In this implementation the master element is the last selected row.
Note: this method can be used only if the selectset has been enabled, otherwise UnsupportedOperationException will be throws.- Returns:
- The HashGetter containing the selected element's data, or null if the selection is empty.
-
getRows
Return an ArrayList containing the row's indexes of the selected rows. In case the DBView is istantiated but no rows was selected, return an empty ArrayList. In case the DBView was not instantiated, the method return null.- Returns:
- The ArrayList containing the row's indexes of the selected rows, or null
-