org.tastybug.bugwerk.bugtrail.widget.queue
Class TicketQueueTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.tastybug.bugwerk.bugtrail.widget.queue.TicketQueueTableModel
All Implemented Interfaces:
Serializable, TableModel

public class TicketQueueTableModel
extends AbstractTableModel

This is the table model of TicketQueueTable.
It displays 4 columns: the ticket Id, ticket type, incident count and ticket state. It is based on a given ticket queue and is not editable.


Copyright 2006 Philipp Bartsch.
www.tastybug.com

Created on Feb 8, 2006

Author:
Philipp Bartsch, philipp.bartsch{at}tastybug{dot}com
See Also:
Serialized Form

Field Summary
protected static String[] columns
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
protected TicketQueueTableModel(TicketQueue _ticketQueue)
          Creates the model.
 
Method Summary
 Class getColumnClass(int c)
          Returns String.class.
 int getColumnCount()
          Returns 4.
 String getColumnName(int col)
          Returns the column name at position col.
 int getRowCount()
          Returns the number of rows, which is equal to the number of tickets in the connected queue.
 Ticket getTicketAt(int rowNumber)
          Returns the ticket at row rowNumber.
 Object getValueAt(int row, int col)
          Returns a cell value.
 boolean isEditable()
          Returns false.
 void update()
          (Re-)reads all tickets from the queue.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, 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

columns

protected static final String[] columns
Constructor Detail

TicketQueueTableModel

protected TicketQueueTableModel(TicketQueue _ticketQueue)
Creates the model.

Parameters:
_ticketQueue - the connected queue
Method Detail

getColumnName

public String getColumnName(int col)
Returns the column name at position col.

Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel
See Also:
AbstractTableModel.getColumnName(int)

update

public void update()
(Re-)reads all tickets from the queue.


getColumnCount

public int getColumnCount()
Returns 4.

See Also:
TableModel.getColumnCount()

isEditable

public boolean isEditable()
Returns false.

Returns:
false

getRowCount

public int getRowCount()
Returns the number of rows, which is equal to the number of tickets in the connected queue.

See Also:
TableModel.getRowCount()

getTicketAt

public Ticket getTicketAt(int rowNumber)
Returns the ticket at row rowNumber.

Parameters:
rowNumber - the rowNumber
Returns:
the ticket or null, if rowNumber exceeds the number of tickets

getValueAt

public Object getValueAt(int row,
                         int col)
Returns a cell value.

See Also:
TableModel.getValueAt(int, int)

getColumnClass

public Class getColumnClass(int c)
Returns String.class.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel
See Also:
AbstractTableModel.getColumnClass(int)


Copyright © 2006-2007 TastyBug Development. All Rights Reserved.