SalesPoint Framework v3.1

data.swing
Class DefaultCountingStockItemTED

java.lang.Object
  extended byutil.swing.AbstractTableEntryDescriptor
      extended bydata.swing.DefaultCatalogItemTED
          extended bydata.swing.DefaultCountingStockItemTED
All Implemented Interfaces:
Serializable, 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
Author:
Steffen Zschaler
See Also:
Serialized Form

Constructor Summary
DefaultCountingStockItemTED()
          Create a new DefaultCountingStockItemTED.
 
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

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.
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.

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

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

Specified by:
getValueAt in interface TableEntryDescriptor
Overrides:
getValueAt in class DefaultCatalogItemTED
Returns:
the item's name for the first, its value for the second and the number of items for the third column.
Override:
Sometimes

SalesPoint Framework v3.1