Class UserAccessTableModel

All Implemented Interfaces:
ConfigurableColumnTableModel, DynamicColumnTableModel<User>, RowObjectTableModel<User>, SelectionStorage<User>, SortedTableModel, VariableColumnTableModel, Serializable, EventListener, ChangeListener, TableModel

public class UserAccessTableModel extends GDynamicColumnTableModel<User,List<User>>
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 Details

  • Constructor Details

    • UserAccessTableModel

      public UserAccessTableModel(String currentUser, List<User> userList, ServiceProvider serviceProvider)
      Constructs a new table model.
      Parameters:
      currentUser - the name of the current user
      userList - list of all users associated with the current project
      serviceProvider - the service provider
  • Method Details

    • getName

      public String getName()
      Description copied from interface: RowObjectTableModel
      Returns the name of this model
      Returns:
      the name of this model
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      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 interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
    • 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 interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
    • createTableColumnDescriptor

      protected TableColumnDescriptor<User> createTableColumnDescriptor()
      Specified by:
      createTableColumnDescriptor in class GDynamicColumnTableModel<User,List<User>>
    • getDataSource

      public List<User> getDataSource()
      Description copied from class: GDynamicColumnTableModel
      Returns the table's context for the data.
      Specified by:
      getDataSource in class GDynamicColumnTableModel<User,List<User>>
      Returns:
      the table's context for the data.
    • setUserList

      public void setUserList(List<User> users)
      Replaces the contents of this model with a given list of users.
      Parameters:
      users - the user list
    • removeUsers

      public void removeUsers(List<User> removedUsers)
      Remove a list of users from the table.
      Parameters:
      removedUsers - list of User objects
    • addUsers

      public void addUsers(List<User> addedUsers)
      Add a list of users to the table.
      Parameters:
      addedUsers - list of User objects
    • getModelData

      public List<User> 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.