org.salespointframework.desktop.teds
Class DefaultMoneyBagItemTED

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

public class DefaultMoneyBagItemTED
extends DefaultCountingStockItemTED

A TableEntryDescriptor that can be used to model MoneyBags with a CountingStockTableModel.

Essentially this is a DefaultCountingStockItemTED that renders its value column using a Currency to format the values.

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

Field Summary
private  Currency m_cCurrency
          The Currency used for formatting.
private  javax.swing.table.TableCellRenderer m_tcrValueRenderer
          The cell renderer that renders the value column.
 
Constructor Summary
DefaultMoneyBagItemTED(Currency c)
          Create a new DefaultMoneyBagItemTED.
 
Method Summary
 javax.swing.table.TableCellRenderer getCellRenderer(int nIdx)
          Returns null to indicate that the default cell renderer is to be used based on the cell value's class.
 java.lang.Class<?> getColumnClass(int nIdx)
          Return the class of objects that make up the values of cells of the given column.
protected  javax.swing.table.TableCellRenderer getValueRenderer()
          Internal helper function that gets (and if necessary creates) the cell renderer for the value column.
 
Methods inherited from class org.salespointframework.desktop.teds.DefaultCountingStockItemTED
getColumnCount, getColumnName, getValueAt
 
Methods inherited from class org.salespointframework.desktop.teds.AbstractTableEntryDescriptor
canSortByColumn, getCellEditor, getColumnOrder, isElementEditable, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_cCurrency

private Currency m_cCurrency
The Currency used for formatting.


m_tcrValueRenderer

private transient javax.swing.table.TableCellRenderer m_tcrValueRenderer
The cell renderer that renders the value column.

Constructor Detail

DefaultMoneyBagItemTED

public DefaultMoneyBagItemTED(Currency c)
Create a new DefaultMoneyBagItemTED.

Parameters:
c - the Currency used for formatting. Must be the same as the Currency of the MoneyBag modelled by the associated CountingStockTableModel.
Method Detail

getValueRenderer

protected javax.swing.table.TableCellRenderer getValueRenderer()
Internal helper function that gets (and if necessary creates) the cell renderer for the value 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 DefaultCountingStockItemTED
Parameters:
nIdx - the index of the column for which to return the value class. Indices run from 0 to getColumnCount() - 1.
Returns:
NumberValue.class for the second column, otherwise the superclass' return values.

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int nIdx)
Description copied from class: AbstractTableEntryDescriptor
Returns null to indicate that the default cell renderer is to be used based on the cell value's class.

Specified by:
getCellRenderer in interface TableEntryDescriptor
Overrides:
getCellRenderer in class AbstractTableEntryDescriptor
Parameters:
nIdx - the index of the column for which to return the renderer. Indices run from 0 to getColumnCount() - 1.
Returns:
null for the first, getValueRenderer() for the second column.