Class TableChooserTableModel
- All Implemented Interfaces:
ConfigurableColumnTableModel,DynamicColumnTableModel<AddressableRowObject>,RowObjectFilterModel<AddressableRowObject>,RowObjectTableModel<AddressableRowObject>,SelectionStorage<AddressableRowObject>,SortedTableModel,VariableColumnTableModel,ProgramTableModel,Serializable,EventListener,ChangeListener,TableModel
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class docking.widgets.table.threaded.ThreadedTableModel
ThreadedTableModel.IncrementalLoadJobListener -
Field Summary
Fields inherited from class ghidra.util.table.GhidraProgramTableModel
programFields inherited from class docking.widgets.table.threaded.ThreadedTableModel
allData, filteredDataFields inherited from class docking.widgets.table.GDynamicColumnTableModel
columnSettings, serviceProvider, tableColumnsFields inherited from class docking.widgets.table.AbstractSortedTableModel
hasEverSortedFields inherited from class docking.widgets.table.AbstractGTableModel
isDisposed, WIDTH_UNDEFINEDFields inherited from class javax.swing.table.AbstractTableModel
listenerListFields inherited from interface docking.widgets.table.RowObjectFilterModel
SUB_FILTERING_DISABLED_PROPERTYFields inherited from interface docking.widgets.table.SortedTableModel
ASCENDING_ORDER, DESCENDING_ORDER -
Constructor Summary
ConstructorsConstructorDescriptionTableChooserTableModel(String title, ServiceProvider serviceProvider, Program program, TaskMonitor monitor) -
Method Summary
Modifier and TypeMethodDescription<T> voidaddCustomColumn(ColumnDisplay<T> columnDisplay) voidaddObject(AddressableRowObject rowObject) Adds the specified object to this model and schedules an update.booleanprotected Comparator<AddressableRowObject> createSortComparator(int columnIndex) An extension point for subclasses to insert their own comparator objects for their data.protected TableColumnDescriptor<AddressableRowObject> protected voiddoLoad(Accumulator<AddressableRowObject> accumulator, TaskMonitor monitor) The basic method that all children must implement.getAddress(int row) Returns the best Address for the given row.voidRemoves the specified object from this model and schedules an update.Methods inherited from class ghidra.util.table.GhidraProgramTableModel
dispose, getAddress, getDataSource, getProgram, getProgramForRow, getProgramLocation, getProgramSelection, setProgramMethods inherited from class docking.widgets.table.threaded.ThreadedTableModel
addInitialLoadListener, addInitialLoadListener, addThreadedTableModelListener, backgroundWorkCancelled, cancelAllUpdates, clearData, createAccumulator, createIncrementalLoadJob, doFilter, fireTableChanged, getAddRemoveStrategy, getAllData, getModelData, getModelIndex, getModelRow, getName, getRowCount, getRowObjects, getTableFilter, getUnfilteredData, getUnfilteredIndexForRowObject, getUnfilteredRowCount, getUnfilteredRowObjectForIndex, getValueAt, getViewIndex, getViewRow, hasFilter, initializeSorting, isBusy, isFiltered, isLoadIncrementally, reFilter, reload, removeThreadedTableModelListener, reSort, setIncrementalTaskMonitor, setModelState, setTableFilter, sort, startInitialLoad, updateNow, updateObjectMethods inherited from class docking.widgets.table.GDynamicColumnTableModel
addTableColumn, addTableColumn, addTableColumns, addTableColumns, createSortComparatorForColumn, disposeDynamicColumnData, getColumn, getColumnClass, getColumnCount, getColumnDescription, getColumnDisplayName, getColumnIndex, getColumnIndex, getColumnName, getColumnSettings, getColumnSettingsDefinitions, getColumnValueForRow, getDefaultColumnCount, getHeaderRenderer, getMaxLines, getPreferredColumnWidth, getRenderer, getTableColumnDescriptor, getUniqueIdentifier, isDefaultColumn, isSortable, isVisibleByDefault, loadDiscoveredTableColumns, reloadColumns, removeTableColumn, removeTableColumns, setAllColumnSettings, stateChangedMethods inherited from class docking.widgets.table.AbstractSortedTableModel
addSortListener, cleanupTableSortState, createSortingContext, getIndexForRowObject, getIndexForRowObject, getPendingSortState, getPrimarySortColumnIndex, getRowIndex, getRowObject, getTableSortState, isSorted, isSortPending, notifyModelSorted, setDefaultTableSortState, setTableSortState, sortCompletedMethods inherited from class docking.widgets.table.AbstractGTableModel
getLastSelectedObjects, isDisposed, refresh, setLastSelectedObjectsMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAtMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface docking.widgets.table.RowObjectTableModel
fireTableDataChanged, getColumnValueForRow, getRowIndex, getRowObjectMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, isCellEditable, removeTableModelListener, setValueAt
-
Constructor Details
-
TableChooserTableModel
public TableChooserTableModel(String title, ServiceProvider serviceProvider, Program program, TaskMonitor monitor)
-
-
Method Details
-
addObject
Description copied from class:ThreadedTableModelAdds the specified object to this model and schedules an update.- Overrides:
addObjectin classThreadedTableModel<AddressableRowObject,Program> - Parameters:
rowObject- the object to add
-
removeObject
Description copied from class:ThreadedTableModelRemoves the specified object from this model and schedules an update.Note: for this method to function correctly, the given object must compare as
Object.equals(Object)and have the sameObject.hashCode()as the object to be removed from the table data. This allows clients to create proxy objects to pass into this method, as long as they honor those requirements.If this model's data is sorted, then a binary search will be used to locate the item to be removed. However, for this to work, all field used to sort the data must still be available from the original object and must be the same values. If this is not true, then the binary search will not work and a brute force search will be used.
- Overrides:
removeObjectin classThreadedTableModel<AddressableRowObject,Program> - Parameters:
obj- the object to remove
-
containsObject
-
getAddress
Description copied from class:GhidraProgramTableModelReturns the best Address for the given row.Implementation Note: this class will only return an Address if this model's row type is Address. Clients that know how to get an Address for a given row should override this method.
- Overrides:
getAddressin classGhidraProgramTableModel<AddressableRowObject>- Parameters:
row- the row- Returns:
- the Address or null
-
doLoad
protected void doLoad(Accumulator<AddressableRowObject> accumulator, TaskMonitor monitor) throws CancelledException Description copied from class:ThreadedTableModelThe basic method that all children must implement. This is where children load their data.- Specified by:
doLoadin classThreadedTableModel<AddressableRowObject,Program> - Parameters:
accumulator- the datastructure into which you should incrementally place you table row datamonitor- the task monitor to check for cancellations and to update progress- Throws:
CancelledException- if the task monitor has been cancelled and a call is made tomonitor.checkCancelled();.
-
addCustomColumn
-
createSortComparator
Description copied from class:AbstractSortedTableModelAn extension point for subclasses to insert their own comparator objects for their data. Subclasses can create comparators for a single or multiple columns, as desired.- Overrides:
createSortComparatorin classThreadedTableModel<AddressableRowObject,Program> - Parameters:
columnIndex- the column index- Returns:
- the comparator
-
createTableColumnDescriptor
- Overrides:
createTableColumnDescriptorin classGhidraProgramTableModel<AddressableRowObject>
-