import data.*;
import data.swing.*;
import sale.*;
public class OfferTED extends DefaultMoneyBagItemTED
{
private boolean withCount;
public OfferTED(boolean withCount)
{
super((Currency)Shop.getTheShop().getCatalog("DM"));
this.withCount = withCount;
}
public int getColumnCount()
{
return withCount?3:2;
}
public String getColumnName(int nIndex)
{
return (new String[] {"Name", "Price", "Available"}) [nIndex];
}
public Object getValueAt(Object oRecord, int nIndex)
{
if (nIndex == 1) {
VideoCassette vidCassette = (VideoCassette)(
(CountingStockTableModel.Record)oRecord).getDescriptor();
return ((QuoteValue)vidCassette.getValue()).getBid();
}
else return super.getValueAt(oRecord, nIndex);
}
}