Package org.zaproxy.zap.view.table
Interface HistoryReferencesTableModel<T extends HistoryReferencesTableEntry>
-
- Type Parameters:
T
- the type of entries of this table model
- All Superinterfaces:
javax.swing.table.TableModel
- All Known Implementing Classes:
AbstractCustomColumnHistoryReferencesTableModel
,AbstractHistoryReferencesTableModel
,ActiveScanTableModel
,CallbackTableModel
,DefaultCustomColumnHistoryReferencesTableModel
,DefaultHistoryReferencesTableModel
,SearchResultsTableModel
public interface HistoryReferencesTableModel<T extends HistoryReferencesTableEntry> extends javax.swing.table.TableModel
ATableModel
specialised in displaying data ofHistoryReference
s and handling them.- See Also:
TableModel
,HistoryReference
,HistoryReferencesTable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HistoryReferencesTableModel.Column
The default columns supported by the table model for state ofHistoryReference
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addEntry(T entry)
Appends the givenentry
to the end of the entries.void
clear()
Removes all the entries.HistoryReferencesTableModel.Column
getColumn(int columnIndex)
Returns theColumn
at the given column index.int
getColumnIndex(HistoryReferencesTableModel.Column column)
Returns the index of the givencolumn
.HistoryReferencesTableModel.Column[]
getColumns()
Returns allColumn
s enabled.T
getEntry(int rowIndex)
Returns the entry at the givenrowIndex
.int
getEntryRowIndex(int historyReferenceId)
Returns the row index of the entry with the givenhistoryReferenceId
.T
getEntryWithHistoryId(int historyReferenceId)
Returns the entry with the givenhistoryReferenceId
.java.lang.Object
getPrototypeValue(int columnIndex)
Returns the prototype value for the given column index.boolean
isColumnEnabled(HistoryReferencesTableModel.Column column)
Tells whether the givencolumn
is enabled.void
refreshEntryRow(int historyReferenceId)
Notifies the table model listeners that the entry with the givenhistoryReferenceId
has changed.void
removeEntry(int historyReferenceId)
Removes the entry with the givenhistoryReferenceId
.
-
-
-
Method Detail
-
getColumns
HistoryReferencesTableModel.Column[] getColumns()
Returns allColumn
s enabled.- Returns:
- all
Column
s enabled.
-
getColumn
HistoryReferencesTableModel.Column getColumn(int columnIndex)
Returns theColumn
at the given column index.- Parameters:
columnIndex
- the column index used to get theColumn
- Returns:
- the
Column
at the given column index - Throws:
java.lang.IllegalArgumentException
- ifcolumnIndex
is not valid (is negative, greater or equal than the number of columns).
-
getColumnIndex
int getColumnIndex(HistoryReferencesTableModel.Column column)
Returns the index of the givencolumn
. If the givencolumn
is not enabled,null
is returned.- Parameters:
column
- the column that will be searched- Returns:
- the index of the given
column
, ornull
if not enabled. - Throws:
java.lang.IllegalArgumentException
- ifcolumn
isnull
- See Also:
isColumnEnabled(Column)
-
isColumnEnabled
boolean isColumnEnabled(HistoryReferencesTableModel.Column column)
Tells whether the givencolumn
is enabled. A column is enabled if the table model was configured to use it.- Parameters:
column
- the column that will be checked- Returns:
true
if the column is enabled,false
otherwise.- Throws:
java.lang.IllegalArgumentException
- ifcolumn
isnull
-
getPrototypeValue
java.lang.Object getPrototypeValue(int columnIndex)
Returns the prototype value for the given column index. The prototype value is a possible representation of the values that might exist in the column. It's used to set an expected width for the column.- Parameters:
columnIndex
- the column index that will be checked.- Returns:
- the prototype value for the column
- Throws:
java.lang.IllegalArgumentException
- ifcolumnIndex
is not valid (is negative, greater or equal than the number of columns).
-
addEntry
void addEntry(T entry)
Appends the givenentry
to the end of the entries.- Parameters:
entry
- the entry that will be added
-
refreshEntryRow
void refreshEntryRow(int historyReferenceId)
Notifies the table model listeners that the entry with the givenhistoryReferenceId
has changed.The call to this method has no effect if there is no entry with the given ID.
- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that has changed- See Also:
TableModelListener
-
removeEntry
void removeEntry(int historyReferenceId)
Removes the entry with the givenhistoryReferenceId
.The call to this method has no effect if there is no entry with the given ID.
- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that will be removed
-
getEntry
T getEntry(int rowIndex)
Returns the entry at the givenrowIndex
.- Parameters:
rowIndex
- the row index of the entry- Returns:
- the entry at the given row index
- Throws:
java.lang.IllegalArgumentException
- ifrowIndex
is not valid (is negative, greater or equal than the number of rows).
-
getEntryWithHistoryId
T getEntryWithHistoryId(int historyReferenceId)
Returns the entry with the givenhistoryReferenceId
. If there is no entry with the given IDnull
is returned.- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that will be returned- Returns:
- the entry with the given
HistoryReference
ID, ornull
if there is no entry with the given ID
-
getEntryRowIndex
int getEntryRowIndex(int historyReferenceId)
Returns the row index of the entry with the givenhistoryReferenceId
. If there is no entry with the given ID -1 is returned.- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that will be searched- Returns:
- the row index of the entry with the given
HistoryReference
ID, or -1 if there is no entry with the given ID
-
clear
void clear()
Removes all the entries.
-
-