001 package data.swing;
002
003 import data.*;
004
005 import util.swing.*;
006
007 /**
008 * A {@link TableEntryDescriptor} that can be used with a {@link StoringStockTableModel}.
009 *
010 * <p>There will be exactly one column headed "Name" and displaying the items' names.</p>
011 *
012 * @author Steffen Zschaler
013 * @version 2.0 23/08/1999
014 * @since v2.0
015 */
016 public class DefaultStockItemTED extends AbstractTableEntryDescriptor {
017
018 /**
019 * @return 1.
020 * @override Sometimes
021 */
022 public int getColumnCount() {
023 return 1;
024 }
025
026 /**
027 * @return "Name".
028 * @override Sometimes
029 */
030 public String getColumnName(int nIdx) {
031 return "Name";
032 }
033
034 /**
035 * @return <code>String.class</code>.
036 * @override Sometimes
037 */
038 public Class getColumnClass(int nIdx) {
039 return String.class;
040 }
041
042 /**
043 * @return the name of the StockItem.
044 * @override Sometimes
045 */
046 public Object getValueAt(Object oData, int nIdx) {
047 return ((StockItem)oData).getName();
048 }
049 }