org.salespointframework.desktop.teds
Class DefaultCountingStockItemTED

java.lang.Object
  extended by org.salespointframework.desktop.teds.AbstractTableEntryDescriptor
      extended by org.salespointframework.desktop.teds.DefaultCatalogItemTED
          extended by org.salespointframework.desktop.teds.DefaultCountingStockItemTED
All Implemented Interfaces:
TableEntryDescriptor
Direct Known Subclasses:
DefaultMoneyBagItemTED

public class DefaultCountingStockItemTED
extends DefaultCatalogItemTED

A TableEntryDescriptor that can be used with a CountingStockTableModel.

There will be three columns: "Name", "Value" and "Count". The first will display the items' names, the secind their values and the third will show how many items of a sort are actually in the Stock.

Since:
v2.0
Version:
2.0 23/08/1999
Author:
Steffen Zschaler

Constructor Summary
DefaultCountingStockItemTED()
          Create a new DefaultCountingStockItemTED.
 
Method Summary
 java.lang.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.
 java.lang.String getColumnName(int nIdx)
          Return the text to be printed in the header of the given column.
 java.lang.Object getValueAt(java.lang.Object oData, int nIdx)
          Get the value to be printed in the given column for the given record.
 
Methods inherited from class org.salespointframework.desktop.teds.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

DefaultCountingStockItemTED

public DefaultCountingStockItemTED()
Create a new DefaultCountingStockItemTED.

Method Detail

getColumnCount

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

Specified by:
getColumnCount in interface TableEntryDescriptor
Overrides:
getColumnCount in class DefaultCatalogItemTED
Returns:
3.

getColumnName

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

Specified by:
getColumnName in interface TableEntryDescriptor
Overrides:
getColumnName in class DefaultCatalogItemTED
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, "Value" for the second and "Count" for the third column.

getColumnClass

public java.lang.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).

Specified by:
getColumnClass in interface TableEntryDescriptor
Overrides:
getColumnClass in class DefaultCatalogItemTED
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, Value.class for the second and Integer.class for the third column.

getValueAt

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

Specified by:
getValueAt in interface TableEntryDescriptor
Overrides:
getValueAt in class DefaultCatalogItemTED
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, its value for the second and the number of items for the third column.