Class TableSelectionContext
- java.lang.Object
-
- com.bc.ceres.core.ExtensibleObject
-
- com.bc.ceres.swing.selection.AbstractSelectionContext
-
- com.bc.ceres.swing.selection.support.TableSelectionContext
-
- All Implemented Interfaces:
Extensible
,SelectionChangeEmitter
,SelectionContext
,SelectionSource
public class TableSelectionContext extends AbstractSelectionContext
-
-
Constructor Summary
Constructors Constructor Description TableSelectionContext(JTable table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Selection
getSelection()
Gets the current selection.JTable
getTable()
protected void
handleTableSelectionChanged(ListSelectionEvent event)
void
setSelection(Selection selection)
Sets the current selection.void
setTable(JTable table)
-
Methods inherited from class com.bc.ceres.swing.selection.AbstractSelectionContext
addSelectionChangeListener, canDeleteSelection, canInsert, canSelectAll, deleteSelection, fireSelectionChange, getSelectionChangeListeners, insert, removeSelectionChangeListener, selectAll
-
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.bc.ceres.core.Extensible
getExtension
-
-
-
-
Constructor Detail
-
TableSelectionContext
public TableSelectionContext(JTable table)
-
-
Method Detail
-
getSelection
public Selection getSelection()
Gets the current selection. The default implementation returns the selected row indices of the table. If overridden, make sure alsosetSelection(Selection)
andhandleTableSelectionChanged(javax.swing.event.ListSelectionEvent)
are appropriately overridden.- Returns:
- The current selection.
- See Also:
Selection.EMPTY
,Selection.isEmpty()
-
setSelection
public void setSelection(Selection selection)
Sets the current selection. The default implementation expects the selected row indices of the table in the given selection. If overridden, make sure alsogetSelection()
andhandleTableSelectionChanged(javax.swing.event.ListSelectionEvent)
are appropriately overridden.- Parameters:
selection
- The current selection.
-
getTable
public JTable getTable()
-
setTable
public void setTable(JTable table)
-
handleTableSelectionChanged
protected void handleTableSelectionChanged(ListSelectionEvent event)
-
-