Package org.zaproxy.zap.view.table
Class AbstractHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.zaproxy.zap.view.table.AbstractHistoryReferencesTableModel<T>
-
- Type Parameters:
T
- the type of table model entries
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
,HistoryReferencesTableModel<T>
- Direct Known Subclasses:
AbstractCustomColumnHistoryReferencesTableModel
,DefaultHistoryReferencesTableModel
public abstract class AbstractHistoryReferencesTableModel<T extends HistoryReferencesTableEntry> extends javax.swing.table.AbstractTableModel implements HistoryReferencesTableModel<T>
An abstract implementation ofHistoryReferencesTableModel
. It contains basic implementation of all the methods except the ones that access the data. the names of all the columns and has- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zaproxy.zap.view.table.HistoryReferencesTableModel
HistoryReferencesTableModel.Column
-
-
Constructor Summary
Constructors Constructor Description AbstractHistoryReferencesTableModel(HistoryReferencesTableModel.Column[] columns)
Constructs anAbstractHistoryReferencesTableModel
with the specified columns (in the specified order).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description HistoryReferencesTableModel.Column
getColumn(int columnIndex)
Returns theColumn
at the given column index.abstract java.lang.Class<?>
getColumnClass(int columnIndex)
Returns theClass
of the given column.int
getColumnCount()
int
getColumnIndex(HistoryReferencesTableModel.Column column)
Returns the index of the givencolumn
.java.lang.String
getColumnName(int columnIndex)
HistoryReferencesTableModel.Column[]
getColumns()
Returns allColumn
s enabled.java.lang.Object
getValueAt(int rowIndex, int columnIndex)
boolean
isColumnEnabled(HistoryReferencesTableModel.Column column)
Tells whether the givencolumn
is enabled.protected boolean
isCustomColumn(int columnIndex)
Tells whether or not the given column index is a custom column.protected static boolean
isCustomColumn(HistoryReferencesTableModel.Column[] columns, int columnIndex)
Tells whether or not the given column index in the given columns is a custom column.-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.zaproxy.zap.view.table.HistoryReferencesTableModel
addEntry, clear, getEntry, getEntryRowIndex, getEntryWithHistoryId, getPrototypeValue, refreshEntryRow, removeEntry
-
-
-
-
Constructor Detail
-
AbstractHistoryReferencesTableModel
public AbstractHistoryReferencesTableModel(HistoryReferencesTableModel.Column[] columns)
Constructs anAbstractHistoryReferencesTableModel
with the specified columns (in the specified order).- Parameters:
columns
- the columns that will have the model- Throws:
java.lang.IllegalArgumentException
- ifcolumns
is null or empty.
-
-
Method Detail
-
isCustomColumn
protected boolean isCustomColumn(int columnIndex)
Tells whether or not the given column index is a custom column.- Parameters:
columnIndex
- the column index- Returns:
true
if it is a custom column,false
otherwise.- See Also:
HistoryReferencesTableModel.Column.CUSTOM
-
getColumnClass
public abstract java.lang.Class<?> getColumnClass(int columnIndex)
Returns theClass
of the given column.- Specified by:
getColumnClass
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnClass
in classjavax.swing.table.AbstractTableModel
- Parameters:
columnIndex
- the column being queried- Returns:
- the
Class
of the column
-
getColumns
public HistoryReferencesTableModel.Column[] getColumns()
Description copied from interface:HistoryReferencesTableModel
Returns allColumn
s enabled.- Specified by:
getColumns
in interfaceHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
- Returns:
- all
Column
s enabled.
-
getColumn
public HistoryReferencesTableModel.Column getColumn(int columnIndex)
Description copied from interface:HistoryReferencesTableModel
Returns theColumn
at the given column index.- Specified by:
getColumn
in interfaceHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
- Parameters:
columnIndex
- the column index used to get theColumn
- Returns:
- the
Column
at the given column index
-
getColumnIndex
public int getColumnIndex(HistoryReferencesTableModel.Column column)
Description copied from interface:HistoryReferencesTableModel
Returns the index of the givencolumn
. If the givencolumn
is not enabled,null
is returned.- Specified by:
getColumnIndex
in interfaceHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
- Parameters:
column
- the column that will be searched- Returns:
- the index of the given
column
, ornull
if not enabled. - See Also:
HistoryReferencesTableModel.isColumnEnabled(Column)
-
isColumnEnabled
public boolean isColumnEnabled(HistoryReferencesTableModel.Column column)
Description copied from interface:HistoryReferencesTableModel
Tells whether the givencolumn
is enabled. A column is enabled if the table model was configured to use it.- Specified by:
isColumnEnabled
in interfaceHistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
- Parameters:
column
- the column that will be checked- Returns:
true
if the column is enabled,false
otherwise.
-
getColumnName
public java.lang.String getColumnName(int columnIndex)
- Specified by:
getColumnName
in interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
-
getColumnCount
public int getColumnCount()
- Specified by:
getColumnCount
in interfacejavax.swing.table.TableModel
-
getValueAt
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
- Specified by:
getValueAt
in interfacejavax.swing.table.TableModel
-
isCustomColumn
protected static boolean isCustomColumn(HistoryReferencesTableModel.Column[] columns, int columnIndex)
Tells whether or not the given column index in the given columns is a custom column.- Parameters:
columns
- the columns that will checkedcolumnIndex
- the column index- Returns:
true
if it is a custom column,false
otherwise.
-
-