Package org.cesilko.rachota.gui
Class RegularTasksTableModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- 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
Fields Modifier and Type Field Description 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.
-
Constructor Summary
Constructors Constructor Description RegularTasksTableModel(java.util.Vector regularTasks)
Creates new table model for regular tasks in settings dialog.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
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
-
-
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 interfacejavax.swing.table.TableModel
- Overrides:
getColumnName
in classjavax.swing.table.AbstractTableModel
- Parameters:
column
- Number of column.- Returns:
- Name of column by given column number.
-
-