SalesPoint Framework v3.1

data.swing
Class DefaultCurrencyItemTED

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

public class DefaultCurrencyItemTED
extends DefaultCatalogItemTED

A TableEntryDescriptor that can be used to model Currencies with a CatalogTableModel.

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

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

Constructor Summary
DefaultCurrencyItemTED(Currency c)
          Create a new DefaultCurrencyItemTED.
 
Method Summary
 TableCellRenderer getCellRenderer(int nIdx)
          Returns null to indicate that the default cell renderer is to be used based on the cell value's class.
 Class getColumnClass(int nIdx)
          Return the class of objects that make up the values of cells of the given column.
protected  TableCellRenderer getValueRenderer()
          Internal helper function that gets (and if necessary creates) the cell renderer for the value column.
 
Methods inherited from class data.swing.DefaultCatalogItemTED
getColumnCount, getColumnName, getValueAt
 
Methods inherited from class util.swing.AbstractTableEntryDescriptor
canSortByColumn, getCellEditor, getColumnOrder, isElementEditable, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultCurrencyItemTED

public DefaultCurrencyItemTED(Currency c)
Create a new DefaultCurrencyItemTED.

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

getValueRenderer

protected TableCellRenderer getValueRenderer()
Internal helper function that gets (and if necessary creates) the cell renderer for the value column.

Override:
Never

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, NumberValue.class for the second column.
Override:
Sometimes

getCellRenderer

public 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
Returns:
null for the first, getValueRenderer() for the second column.
Override:
Sometimes

SalesPoint Framework v3.1