Package PamView.component
Class DataBlockTableView<T extends PamDataUnit>
java.lang.Object
PamView.component.DataBlockTableView<T>
- Direct Known Subclasses:
CalibrationTableView
,EffortTableView
,QAOpsTable
,QATestTable
,RXTablePanel2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
If right clicking, may have right clicked on a different row, so consider changing the row selectionvoid
Call the table data changed function to update table values.void
Call the fireTableStructureChanged function for the table.Class
<?> getColumnClass
(int columnIndex) The class of the table column.abstract Object
getColumnData
(T dataUnit, int column) Data for a particular column extracted from the data unit.getColumnName
(int column) Put the getColumnName function out here, so that subclasses can more easily override it than if it's buried in the table modelabstract String[]
int
getDataIndexForRow
(int tableRow) Get the absolute index of the data within the PAMDataBlock for the row in the table.protected final T
getDataUnit
(int tableRow) The data unit for a given row.T[]
Check for multiple row selection.int
Get the number of rows in the table - default behaviour is the number of rows in the datablock, but this may be overridden if data are being selected in a different way.Get the data unit for the selected data rowgetTable()
Get table.getToolTipText
(T dataUnit, int columnIndex) Get a tooltip for the data unit.void
popupMenuAction
(MouseEvent e, T dataUnit, String colName) void
setAllowMultipleRowSelection
(boolean allow) Set allowing of multiple row selection.void
showViewerScrollControls
(boolean show) Show the scroll bar controls at the top of the display in viewer mode.
-
Constructor Details
-
Method Details
-
fireTableStructureChanged
public void fireTableStructureChanged()Call the fireTableStructureChanged function for the table. -
fireTableDataChanged
public void fireTableDataChanged()Call the table data changed function to update table values. -
getComponent
-
showViewerScrollControls
public void showViewerScrollControls(boolean show) Show the scroll bar controls at the top of the display in viewer mode. The are on by default, so if you call this, it will probably be with 'false'- Parameters:
show
- show controls
-
getTable
Get table. Allows adding of more menu handlers, etc.- Returns:
- the table object.
-
setAllowMultipleRowSelection
public void setAllowMultipleRowSelection(boolean allow) Set allowing of multiple row selection.- Parameters:
allow
-
-
getToolTipText
Get a tooltip for the data unit.- Parameters:
dataUnit
- Data unit for the row the mouse is over - note that this might be nullcolumnIndex
- column the mouse is over.- Returns:
- tool tip text or null
-
getColumnNames
- Returns:
- a list of column names.
-
getColumnData
Data for a particular column extracted from the data unit.- Parameters:
dataUnit
-column
-- Returns:
-
getColumnClass
The class of the table column. Defaults to 'Object' can be overridden.- Parameters:
columnIndex
-- Returns:
-
getDataUnit
The data unit for a given row. Note that in some circumstances this may return null since data may get removed in a different thread between asking for the number of rows and trying to get the data.- Parameters:
tableRow
-- Returns:
- data unit for the table row.
-
getSelectedDataUnit
Get the data unit for the selected data row- Returns:
-
getRowCount
public int getRowCount()Get the number of rows in the table - default behaviour is the number of rows in the datablock, but this may be overridden if data are being selected in a different way.- Returns:
- number of table rows to show.
-
getDataIndexForRow
public int getDataIndexForRow(int tableRow) Get the absolute index of the data within the PAMDataBlock for the row in the table. Default behaviour is that in viewer mode, there is 1:1 correspondence, so data are displayed in order. In normal mode, data are displayed in reverse oder, with newest data in row 0.- Parameters:
tableRow
-- Returns:
-
popupMenuAction
-
getMultipleSelectedRows
Check for multiple row selection.If wanted, this should be called back from implementations of popupMenuAction
- Returns:
- Array of multiple rows selected.
-
checkRowSelection
If right clicking, may have right clicked on a different row, so consider changing the row selection- Parameters:
e
-
-
getColumnName
Put the getColumnName function out here, so that subclasses can more easily override it than if it's buried in the table model- Parameters:
column
-- Returns:
- colum name
-