org.cesilko.rachota.gui
Class RegularTasksTableModel

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

public class RegularTasksTableModel
extends javax.swing.table.AbstractTableModel

Table model for regular tasks in settings dialog.

See Also:
Serialized Form

Field Summary
static int TASK_DESCRIPTION
          Identification of task description column.
static int TASK_PRIORITY
          Identification of task priority column.
static int TASK_REGULAR
          Identification of task frequency column.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
RegularTasksTableModel(java.util.Vector regularTasks)
          Creates new table model for regular tasks in settings dialog.
 
Method Summary
 int getColumnCount()
          Returns number of columns in the table i.e.
 java.lang.String getColumnName(int column)
          Returns name of column by given column number.
 int getRowCount()
          Returns number of rows (regular tasks) in the table.
 java.lang.Object getValueAt(int row, int column)
          Returns value of cell located in given row and column.
 java.util.Vector sortTable(int column)
          Sorts table according to given column and known order.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TASK_PRIORITY

public static final int TASK_PRIORITY
Identification of task priority column.

See Also:
Constant Field Values

TASK_DESCRIPTION

public static final int TASK_DESCRIPTION
Identification of task description column.

See Also:
Constant Field Values

TASK_REGULAR

public static final int TASK_REGULAR
Identification of task frequency column.

See Also:
Constant Field Values
Constructor Detail

RegularTasksTableModel

public RegularTasksTableModel(java.util.Vector regularTasks)
Creates new table model for regular tasks in settings dialog.

Parameters:
regularTasks - Set of currently planned regular tasks.
Method Detail

sortTable

public java.util.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 java.lang.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 java.lang.String getColumnName(int column)
Returns name of column by given column number.

Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel
Parameters:
column - Number of column.
Returns:
Name of column by given column number.