Package ghidra.framework.main
Class UserAccessTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
docking.widgets.table.AbstractGTableModel<User>
docking.widgets.table.AbstractSortedTableModel<User>
docking.widgets.table.GDynamicColumnTableModel<User,List<User>>
ghidra.framework.main.UserAccessTableModel
- All Implemented Interfaces:
ConfigurableColumnTableModel,DynamicColumnTableModel<User>,RowObjectTableModel<User>,SelectionStorage<User>,SortedTableModel,VariableColumnTableModel,Serializable,EventListener,ChangeListener,TableModel
Table model for managing a list of Ghidra users associated with a project, and
their access permissions. The permissions (read-only, read/write, admin) are rendered
as checkboxes that can be selected by users, provided they have admin access.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intFields 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.SortedTableModel
ASCENDING_ORDER, DESCENDING_ORDER -
Constructor Summary
ConstructorsConstructorDescriptionUserAccessTableModel(String currentUser, List<User> userList, ServiceProvider serviceProvider) Constructs a new table model. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a list of users to the table.protected TableColumnDescriptor<User> Returns the table's context for the data.Implementors should return the current data of the model.getName()Returns the name of this modelbooleanisCellEditable(int rowIndex, int columnIndex) The permissions columns in the table should be editable as long as the user is an admin and is not trying to adjust his/her own permissions.voidremoveUsers(List<User> removedUsers) Remove a list of users from the table.voidsetUserList(List<User> users) Replaces the contents of this model with a given list of users.voidsetValueAt(Object aValue, int rowIndex, int columnIndex) Invoked when the user has changed one of the access rights checkboxes.Methods inherited from class docking.widgets.table.GDynamicColumnTableModel
addTableColumn, addTableColumn, addTableColumns, addTableColumns, createSortComparator, createSortComparatorForColumn, dispose, 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, fireTableChanged, getIndexForRowObject, getIndexForRowObject, getPendingSortState, getPrimarySortColumnIndex, getRowIndex, getRowObject, getTableSortState, getValueAt, initializeSorting, isSorted, isSortPending, notifyModelSorted, reSort, setDefaultTableSortState, setTableSortState, sort, sortCompletedMethods inherited from class docking.widgets.table.AbstractGTableModel
getLastSelectedObjects, getRowCount, isDisposed, refresh, setLastSelectedObjectsMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerMethods 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, getRowIndex, getRowObjectMethods inherited from interface javax.swing.table.TableModel
addTableModelListener, getRowCount, getValueAt, removeTableModelListener
-
Field Details
-
USERS_COL
public static final int USERS_COL- See Also:
-
READ_ONLY_COL
public static final int READ_ONLY_COL- See Also:
-
READ_WRITE_COL
public static final int READ_WRITE_COL- See Also:
-
ADMIN_COL
public static final int ADMIN_COL- See Also:
-
-
Constructor Details
-
UserAccessTableModel
public UserAccessTableModel(String currentUser, List<User> userList, ServiceProvider serviceProvider) Constructs a new table model.- Parameters:
currentUser- the name of the current useruserList- list of all users associated with the current projectserviceProvider- the service provider
-
-
Method Details
-
getName
Description copied from interface:RowObjectTableModelReturns the name of this model- Returns:
- the name of this model
-
setValueAt
Invoked when the user has changed one of the access rights checkboxes. When this happens we have to update the associated User data.- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int rowIndex, int columnIndex) The permissions columns in the table should be editable as long as the user is an admin and is not trying to adjust his/her own permissions.- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
createTableColumnDescriptor
- Specified by:
createTableColumnDescriptorin classGDynamicColumnTableModel<User,List<User>>
-
getDataSource
Description copied from class:GDynamicColumnTableModelReturns the table's context for the data.- Specified by:
getDataSourcein classGDynamicColumnTableModel<User,List<User>> - Returns:
- the table's context for the data.
-
setUserList
Replaces the contents of this model with a given list of users.- Parameters:
users- the user list
-
removeUsers
Remove a list of users from the table.- Parameters:
removedUsers- list of User objects
-
addUsers
Add a list of users to the table.- Parameters:
addedUsers- list of User objects
-
getModelData
Description copied from interface:RowObjectTableModelImplementors should return the current data of the model. For models that support filtering, this will be the filtered version of the data. Furthermore, the data should be the underlying data and not a copy, as this method will potentially sort the given data.For those subclasses using an array, you may use the
Arraysclass to create a list backed by the array (Arrays.asList(Object...)).- Returns:
- the model data.
-