Class RegularTasksTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
org.cesilko.rachota.gui.RegularTasksTableModel
All Implemented Interfaces:
Serializable, TableModel

public class RegularTasksTableModel extends AbstractTableModel
Table model for regular tasks in settings dialog.
See Also:
  • Field Details

    • TASK_PRIORITY

      public static final int TASK_PRIORITY
      Identification of task priority column.
      See Also:
    • TASK_DESCRIPTION

      public static final int TASK_DESCRIPTION
      Identification of task description column.
      See Also:
    • TASK_REGULAR

      public static final int TASK_REGULAR
      Identification of task frequency column.
      See Also:
  • Constructor Details

    • RegularTasksTableModel

      public RegularTasksTableModel(Vector regularTasks)
      Creates new table model for regular tasks in settings dialog.
      Parameters:
      regularTasks - Set of currently planned regular tasks.
  • Method Details

    • sortTable

      public Vector sortTable(int column)
      Sorts table according to given column and known order.
      Parameters:
      column - Column that will be used for sorting.
      Returns:
      Vector of sorted regular tasks.
    • getColumnCount

      public int getColumnCount()
      Returns number of columns in the table i.e. 3.
      Returns:
      Always 3 since table has three columns.
    • getRowCount

      public int getRowCount()
      Returns number of rows (regular tasks) in the table.
      Returns:
      Number of rows in the table i.e. number of regular tasks.
    • getValueAt

      public Object getValueAt(int row, int column)
      Returns value of cell located in given row and column.
      Parameters:
      row - Number of row.
      column - Number of column.
      Returns:
      Value of cell at specified location.
    • getColumnName

      public String getColumnName(int column)
      Returns name of column by given column number.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      column - Number of column.
      Returns:
      Name of column by given column number.