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 int
static final int
static final int
static final int
Fields inherited from class docking.widgets.table.GDynamicColumnTableModel
columnSettings, serviceProvider, tableColumns
Fields inherited from class docking.widgets.table.AbstractSortedTableModel
hasEverSorted
Fields inherited from class docking.widgets.table.AbstractGTableModel
isDisposed, WIDTH_UNDEFINED
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
Fields 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 TypeMethodDescriptionvoid
Add 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 modelboolean
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.void
removeUsers
(List<User> removedUsers) Remove a list of users from the table.void
setUserList
(List<User> users) Replaces the contents of this model with a given list of users.void
setValueAt
(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, stateChanged
Methods 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, sortCompleted
Methods inherited from class docking.widgets.table.AbstractGTableModel
getLastSelectedObjects, getRowCount, isDisposed, refresh, setLastSelectedObjects
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface docking.widgets.table.RowObjectTableModel
fireTableDataChanged, getRowIndex, getRowObject
Methods 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:RowObjectTableModel
Returns 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:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in 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:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
createTableColumnDescriptor
- Specified by:
createTableColumnDescriptor
in classGDynamicColumnTableModel<User,
List<User>>
-
getDataSource
Description copied from class:GDynamicColumnTableModel
Returns the table's context for the data.- Specified by:
getDataSource
in 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:RowObjectTableModel
Implementors 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
Arrays
class to create a list backed by the array (Arrays.asList(Object...)
).- Returns:
- the model data.
-