SalesPoint Framework v3.1

data.swing
Class DefaultCountingStockDBETableEntryDescriptor

java.lang.Object
  extended byutil.swing.AbstractTableEntryDescriptor
      extended bydata.swing.DefaultCountingStockDBETableEntryDescriptor
All Implemented Interfaces:
Serializable, TableEntryDescriptor

public class DefaultCountingStockDBETableEntryDescriptor
extends AbstractTableEntryDescriptor

A TableEntryDescriptor that can be used with a DataBasketTableModel modelling DataBasketEntries that describe operations on items in a CountingStock.

There will be two columns, headed "Name" and "Count". The first will give the item's name, the second the number of items of that sort available.

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

Constructor Summary
DefaultCountingStockDBETableEntryDescriptor()
          Create a new DefaultCountingStockDBETableEntryDescriptor.
 
Method Summary
 Class getColumnClass(int nIdx)
          Return the class of objects that make up the values of cells of the given column.
 int getColumnCount()
          Return the number of columns each record will consist of.
 String getColumnName(int nIdx)
          Return the text to be printed in the header of the given column.
 Object getValueAt(Object oData, int nIdx)
          Get the value to be printed in the given column for the given record.
 
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

DefaultCountingStockDBETableEntryDescriptor

public DefaultCountingStockDBETableEntryDescriptor()
Create a new DefaultCountingStockDBETableEntryDescriptor.

Method Detail

getColumnCount

public int getColumnCount()
Description copied from interface: TableEntryDescriptor
Return the number of columns each record will consist of.

Returns:
2.
Override:
Sometimes

getColumnName

public String getColumnName(int nIdx)
Description copied from interface: TableEntryDescriptor
Return the text to be printed in the header of the given column.

Parameters:
nIdx - the index of the column for which to return the header. Indices run from 0 to getColumnCount() - 1.
Returns:
"Name" for the first and "Count" for the second column.
Override:
Sometimes

getColumnClass

public Class getColumnClass(int nIdx)
Description copied from interface: TableEntryDescriptor
Return the class of objects that make up the values of cells of the given column. This will be used to determine the cell renderer and editor unless you specify otherwise through TableEntryDescriptor.getCellEditor(int) and TableEntryDescriptor.getCellRenderer(int).

Parameters:
nIdx - the index of the column for which to return the value class. Indices run from 0 to getColumnCount() - 1.
Returns:
String.class for the first and Integer.class for the second column.
Override:
Sometimes

getValueAt

public Object getValueAt(Object oData,
                         int nIdx)
Description copied from interface: TableEntryDescriptor
Get the value to be printed in the given column for the given record.

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 item's name for the first and the number of available items for the second column.
Override:
Sometimes

SalesPoint Framework v3.1