SalesPoint v3.3 API

log.swing
Class DefaultLogEntryTED

java.lang.Object
  extended by util.swing.AbstractTableEntryDescriptor
      extended by log.swing.DefaultLogEntryTED
All Implemented Interfaces:
Serializable, TableEntryDescriptor

public class DefaultLogEntryTED
extends AbstractTableEntryDescriptor

TableEntryDescriptor that can be used to display LogEntries.

LogEntries will be displayed using two columns. The first column will have the heading "Date" and will show the LogEntry's log date. The second column will show the return of the LogEntry's Object.toString() method under the heading "Description". Both columns are not editable.

Since:
v2.0
Author:
Steffen Zschaler
See Also:
Serialized Form

Constructor Summary
DefaultLogEntryTED()
           
 
Method Summary
 Class<?> getColumnClass(int nIdx)
          The column class of the first column is Date.class, that of the second column is String.class.
 int getColumnCount()
          There are two columns.
 String getColumnName(int nIdx)
          The column name of the first column is "Date", that of the second column is "Description".
 Object getValueAt(Object oData, int nIdx)
          The object is assumed to be a LogEntry; the value of the first column is the log date that of the second column is the result of the object's Object.toString() method.
 
Methods inherited from class util.swing.AbstractTableEntryDescriptor
canSortByColumn, getCellEditor, getCellRenderer, getColumnOrder, isElementEditable, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLogEntryTED

public DefaultLogEntryTED()
Method Detail

getColumnCount

public int getColumnCount()
There are two columns.

Returns:
the number of columns each record will consist of.

getColumnName

public String getColumnName(int nIdx)
The column name of the first column is "Date", that of the second column is "Description".

Parameters:
nIdx - the index of the column for which to return the header. Indices run from 0 to getColumnCount() - 1.
Returns:
the text to be printed in the header of the given column.

getColumnClass

public Class<?> getColumnClass(int nIdx)
The column class of the first column is Date.class, that of the second column is String.class.

Parameters:
nIdx - the index of the column for which to return the value class. Indices run from 0 to getColumnCount() - 1.
Returns:
the class of objects that make up the values of cells of the given column.

getValueAt

public Object getValueAt(Object oData,
                         int nIdx)
The object is assumed to be a LogEntry; the value of the first column is the log date that of the second column is the result of the object's Object.toString() method.

Parameters:
oData - the record for which to determine the value. The actual class depends on the AbstractTableModel you are working with. It will be declared in the documentation for the AbstractTableModel.getRecord(int) method of that class.
nIdx - the index of the column for which to return the cell value. Indices run from 0 to getColumnCount() - 1.
Returns:
the value to be printed in the given column for the given record. The actual class must be a subclass of what was returned by TableEntryDescriptor.getColumnClass(int) or that class itself.

SalesPoint v3.3 API