Class RolesTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
edu.tufts.hrilab.action.gui.tablemodels.RolesTableModel
All Implemented Interfaces:
Serializable, TableModel

public class RolesTableModel extends DefaultTableModel
Model for the JTable containing roles. Provides various helper methods and takes care of handling the actual java types.
See Also:
  • Constructor Details

    • RolesTableModel

      public RolesTableModel(ActionDBEntry dbe)
      Initializes the table with the above defined column names.
  • Method Details

    • setRoles

      public void setRoles(ActionDBEntry dbe)
      Sets the roles of a DBEntry in the table.
      Parameters:
      dbe - DBEntry
    • exportRoles

      public boolean exportRoles(ActionDBEntry.Builder adbeb)
      Export the current roles to an ActionDBEntry Builder object.
      Parameters:
      adbeb - builder
      Returns:
      true if success
    • getColumnClass

      public Class getColumnClass(int c)
      JTable uses this method to determine the default renderer/ editor for each cell. If we didn't implement this method, then the return column would contain text ("true"/"false"), rather than a check box.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
      Parameters:
      c - the column being queried
      Returns:
      the class represented in the column
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Disable editing of the first row (actor variable)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class DefaultTableModel
      Parameters:
      rowIndex -
      columnIndex -
      Returns: