Package org.zaproxy.zap.extension.search
Class SearchResultsTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.zaproxy.zap.view.table.AbstractHistoryReferencesTableModel<T>
-
- org.zaproxy.zap.view.table.AbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
-
- org.zaproxy.zap.extension.search.SearchResultsTableModel
-
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
,EventConsumer
,HistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
public class SearchResultsTableModel extends AbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry> implements EventConsumer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SearchResultsTableModel.SearchResultTableEntry
-
Nested classes/interfaces inherited from interface org.zaproxy.zap.view.table.HistoryReferencesTableModel
HistoryReferencesTableModel.Column
-
-
Constructor Summary
Constructors Constructor Description SearchResultsTableModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEntry(SearchResultsTableModel.SearchResultTableEntry entry)
Appends the givenentry
to the end of the entries.void
addSearchResult(SearchResult sr)
void
clear()
Removes all the entries.void
eventReceived(Event event)
protected java.lang.Class<?>
getColumnClass(HistoryReferencesTableModel.Column column)
Returns theClass
of the column.protected java.lang.Class<java.lang.String>
getCustomColumnClass(int columnIndex)
Returns theClass
of the column at the given column index.protected java.lang.String
getCustomColumnName(int columnIndex)
Returns the name of the column at the given column index.protected java.lang.Object
getCustomPrototypeValue(int columnIndex)
Returns the prototype value for the column at the given column index.protected java.lang.Object
getCustomValueAt(SearchResultsTableModel.SearchResultTableEntry entry, int columnIndex)
Returns the value for the entry at the given column index.SearchResultsTableModel.SearchResultTableEntry
getEntry(int rowIndex)
Returns the entry at the givenrowIndex
.int
getEntryRowIndex(int historyReferenceId)
Returns the row index of the entry with the givenhistoryReferenceId
.SearchResultsTableModel.SearchResultTableEntry
getEntryWithHistoryId(int historyReferenceId)
Returns the entry with the givenhistoryReferenceId
.protected java.lang.Object
getPrototypeValue(HistoryReferencesTableModel.Column column)
Returns the prototype value for the given column.int
getRowCount()
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
.-
Methods inherited from class org.zaproxy.zap.view.table.AbstractCustomColumnHistoryReferencesTableModel
getColumnClass, getColumnName, getCustomColumnIndex, getPrototypeValue, getValueAt
-
Methods inherited from class org.zaproxy.zap.view.table.AbstractHistoryReferencesTableModel
getColumn, getColumnCount, getColumnIndex, getColumns, isColumnEnabled, isCustomColumn, isCustomColumn
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
-
-
-
Method Detail
-
addSearchResult
public void addSearchResult(SearchResult sr)
-
addEntry
public void addEntry(SearchResultsTableModel.SearchResultTableEntry entry)
Description copied from interface:HistoryReferencesTableModel
Appends the givenentry
to the end of the entries.- Specified by:
addEntry
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
entry
- the entry that will be added
-
refreshEntryRow
public void refreshEntryRow(int historyReferenceId)
Description copied from interface:HistoryReferencesTableModel
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.
- Specified by:
refreshEntryRow
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that has changed- See Also:
TableModelListener
-
removeEntry
public void removeEntry(int historyReferenceId)
Description copied from interface:HistoryReferencesTableModel
Removes the entry with the givenhistoryReferenceId
.The call to this method has no effect if there is no entry with the given ID.
- Specified by:
removeEntry
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
historyReferenceId
- theHistoryReference
ID of the entry that will be removed
-
getEntry
public SearchResultsTableModel.SearchResultTableEntry getEntry(int rowIndex)
Description copied from interface:HistoryReferencesTableModel
Returns the entry at the givenrowIndex
.- Specified by:
getEntry
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
rowIndex
- the row index of the entry- Returns:
- the entry at the given row index
-
getEntryWithHistoryId
public SearchResultsTableModel.SearchResultTableEntry getEntryWithHistoryId(int historyReferenceId)
Description copied from interface:HistoryReferencesTableModel
Returns the entry with the givenhistoryReferenceId
. If there is no entry with the given IDnull
is returned.- Specified by:
getEntryWithHistoryId
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- 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
public int getEntryRowIndex(int historyReferenceId)
Description copied from interface:HistoryReferencesTableModel
Returns the row index of the entry with the givenhistoryReferenceId
. If there is no entry with the given ID -1 is returned.- Specified by:
getEntryRowIndex
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- 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
public void clear()
Description copied from interface:HistoryReferencesTableModel
Removes all the entries.- Specified by:
clear
in interfaceHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
-
getRowCount
public int getRowCount()
- Specified by:
getRowCount
in interfacejavax.swing.table.TableModel
-
getColumnClass
protected java.lang.Class<?> getColumnClass(HistoryReferencesTableModel.Column column)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns theClass
of the column.- Specified by:
getColumnClass
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
column
- the column- Returns:
- the
Class
of the column
-
getPrototypeValue
protected java.lang.Object getPrototypeValue(HistoryReferencesTableModel.Column column)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns the prototype value for the given column.- Specified by:
getPrototypeValue
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
column
- the column- Returns:
- the prototype value for the column
-
getCustomValueAt
protected java.lang.Object getCustomValueAt(SearchResultsTableModel.SearchResultTableEntry entry, int columnIndex)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns the value for the entry at the given column index. Called when the column is aColumn#CUSTOM
.- Specified by:
getCustomValueAt
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
entry
- the entry with the valuescolumnIndex
- the column index- Returns:
- the entry value at the specified column index
- See Also:
AbstractCustomColumnHistoryReferencesTableModel.getCustomColumnIndex(int)
,HistoryReferencesTableModel.Column.CUSTOM
-
getCustomColumnName
protected java.lang.String getCustomColumnName(int columnIndex)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns the name of the column at the given column index. Called when the column is aColumn#CUSTOM
.- Specified by:
getCustomColumnName
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
columnIndex
- the column index- Returns:
- the name of the custom column
- See Also:
AbstractCustomColumnHistoryReferencesTableModel.getCustomColumnIndex(int)
,HistoryReferencesTableModel.Column.CUSTOM
-
getCustomColumnClass
protected java.lang.Class<java.lang.String> getCustomColumnClass(int columnIndex)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns theClass
of the column at the given column index. Called when the column is aColumn#CUSTOM
.- Specified by:
getCustomColumnClass
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
columnIndex
- the column index- Returns:
- the
Class
of the custom column - See Also:
AbstractCustomColumnHistoryReferencesTableModel.getCustomColumnIndex(int)
,HistoryReferencesTableModel.Column.CUSTOM
-
getCustomPrototypeValue
protected java.lang.Object getCustomPrototypeValue(int columnIndex)
Description copied from class:AbstractCustomColumnHistoryReferencesTableModel
Returns the prototype value for the column at the given column index. Called when the column is aColumn#CUSTOM
.- Specified by:
getCustomPrototypeValue
in classAbstractCustomColumnHistoryReferencesTableModel<SearchResultsTableModel.SearchResultTableEntry>
- Parameters:
columnIndex
- the column index- Returns:
- the prototype value for the column
- See Also:
AbstractCustomColumnHistoryReferencesTableModel.getCustomColumnIndex(int)
,HistoryReferencesTableModel.Column.CUSTOM
-
eventReceived
public void eventReceived(Event event)
- Specified by:
eventReceived
in interfaceEventConsumer
-
-