Package com.illumon.iris.console.db
Class DbKeyedTableSelectionModel
java.lang.Object
com.illumon.iris.gui.table.IrisTableSelectionModel
com.illumon.iris.console.db.DbKeyedTableSelectionModel
- All Implemented Interfaces:
Serializable,Cloneable,ListSelectionModel
A Table selection model that maintains user selection inside and outside the viewport.
When selections are made, key-values are cached and rows are considered selected if:
1) The row is populated
2) The values of the key columns match ont of the selected values
If a long running selection operation is in progress, and another selection event
arrives, it will be ignored. The special case is getTableForSelection which will
retry until it manages to acquire the lock
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsFields inherited from class com.illumon.iris.gui.table.IrisTableSelectionModel
anchorIndex, keys, leadAnchorNotificationEnabled, leadIndex, listenerList, model, selectedKeyValuesFields inherited from interface javax.swing.ListSelectionModel
MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION -
Constructor Summary
ConstructorsConstructorDescriptionDbKeyedTableSelectionModel(GuiTable parent, IrisTableModel model) DbKeyedTableSelectionModel(GuiTable parent, IrisTableModel model, com.fishlib.io.logger.Logger log) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectionInterval(int index0, int index1) Build a table containing the cached key-valueprotected voidchangeSelection(int clearMin, int clearMax, int setMin, int setMax, boolean clearFirst) Change the selection while performing all operations at the same time in the same thread context.voidintintgetSnapshotForSelection(BitSet columns) Get a SnapshotTable containing all selected rows from the original table, including only the specified columns.getSnapshotForSelection(BitSet columns, boolean stripPreview) Get a SnapshotTable containing all selected rows from the original table, including only the specified columns.booleanReturns if the selection is empty.booleanisUnique()Returns true if the keys are unique.voidremoveSelectionInterval(int index0, int index1) voidvoidsetLeadSelectionIndex(int leadIndex) voidsetLogger(com.fishlib.io.logger.Logger log) voidsetSelectionInterval(int index0, int index1) protected voidMethods inherited from class com.illumon.iris.gui.table.IrisTableSelectionModel
addListSelectionListener, clear, clone, contains, fireValueChanged, fireValueChanged, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getKeyCount, getKeys, getLeadSelectionIndex, getListeners, getListSelectionListeners, getSelectionKey, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, markAsDirty, removeIndexInterval, removeListSelectionListener, set, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setSelectionMode, setValueIsAdjusting, updateLeadAnchorIndicesMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.swing.ListSelectionModel
getSelectedIndices, getSelectedItemsCount
-
Field Details
-
keySet
-
-
Constructor Details
-
DbKeyedTableSelectionModel
-
DbKeyedTableSelectionModel
public DbKeyedTableSelectionModel(GuiTable parent, IrisTableModel model, com.fishlib.io.logger.Logger log)
-
-
Method Details
-
isUnique
public boolean isUnique()Returns true if the keys are unique.- Returns:
- true if the keys are unique, false otherwise
-
setLogger
public void setLogger(com.fishlib.io.logger.Logger log) -
setKeys
- Overrides:
setKeysin classIrisTableSelectionModel
-
clearSelection
public void clearSelection()- Specified by:
clearSelectionin interfaceListSelectionModel- Overrides:
clearSelectionin classIrisTableSelectionModel
-
setSelectionInterval
public void setSelectionInterval(int index0, int index1) - Specified by:
setSelectionIntervalin interfaceListSelectionModel- Overrides:
setSelectionIntervalin classIrisTableSelectionModel
-
addSelectionInterval
public void addSelectionInterval(int index0, int index1) - Specified by:
addSelectionIntervalin interfaceListSelectionModel- Overrides:
addSelectionIntervalin classIrisTableSelectionModel
-
removeSelectionInterval
public void removeSelectionInterval(int index0, int index1) - Specified by:
removeSelectionIntervalin interfaceListSelectionModel- Overrides:
removeSelectionIntervalin classIrisTableSelectionModel
-
setLeadSelectionIndex
public void setLeadSelectionIndex(int leadIndex) - Specified by:
setLeadSelectionIndexin interfaceListSelectionModel- Overrides:
setLeadSelectionIndexin classIrisTableSelectionModel
-
isSelectionEmpty
public boolean isSelectionEmpty()Description copied from class:IrisTableSelectionModelReturns if the selection is empty.- Specified by:
isSelectionEmptyin interfaceListSelectionModel- Overrides:
isSelectionEmptyin classIrisTableSelectionModel- Returns:
- true if the selection is empty, false otherwise
-
getMinSelectionIndex
public int getMinSelectionIndex()- Specified by:
getMinSelectionIndexin interfaceListSelectionModel- Overrides:
getMinSelectionIndexin classIrisTableSelectionModel
-
getMaxSelectionIndex
public int getMaxSelectionIndex()- Specified by:
getMaxSelectionIndexin interfaceListSelectionModel- Overrides:
getMaxSelectionIndexin classIrisTableSelectionModel
-
changeSelection
protected void changeSelection(int clearMin, int clearMax, int setMin, int setMax, boolean clearFirst) Change the selection while performing all operations at the same time in the same thread context. If all the rows are available in the viewport and populated, we will cache the values for the key columns directly. If the rows are in the viewport and not populated, or simply not in the viewport, the entire selection operation will be delegated to another thread that will perform all of the selection operations at once. When rows are outside the viewport, the values will be retrieved remotely from the database- Overrides:
changeSelectionin classIrisTableSelectionModel
-
buildSelectionTable
Build a table containing the cached key-value -
getSnapshotForSelection
-
getSnapshotForSelection
Get a SnapshotTable containing all selected rows from the original table, including only the specified columns.- ImplNote:
- This method may result in a whereIn() query, so it must not be invoked on the swing thread.
-
getSnapshotForSelection
Get a SnapshotTable containing all selected rows from the original table, including only the specified columns.- Parameters:
stripPreview- Remove preview columns to return the raw data (e.g., return the complete double [] instead of an array preview)- ImplNote:
- This method may result in a whereIn() query, so it must not be invoked on the swing thread.
-
updateKey
-