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 DataBasketTableModel} modelling
009 * {@link DataBasketEntry DataBasketEntries} that describe operations on {@link CatalogItem CatalogItems}.
010 *
011 * <p>There will be exactly one column, headed "Name" and giving the key of the CatalogItem.</p>
012 *
013 * @author Steffen Zschaler
014 * @version 2.0 23/08/1999
015 * @since v2.0
016 */
017 public class DefaultCatalogItemDBETableEntryDescriptor extends AbstractTableEntryDescriptor {
018
019 /**
020 * Create a new DefaultCatalogItemDBETableEntryDescriptor.
021 */
022 public DefaultCatalogItemDBETableEntryDescriptor() {
023 super();
024 }
025
026 /**
027 * @return 1.
028 * @override Sometimes
029 */
030 public int getColumnCount() {
031 return 1;
032 }
033
034 /**
035 * @return "Name".
036 * @override Sometimes
037 */
038 public String getColumnName(int nIdx) {
039 return "Name";
040 }
041
042 /**
043 * @return <code>String.class</code>.
044 * @override Sometimes
045 */
046 public Class getColumnClass(int nIdx) {
047 return String.class;
048 }
049
050 /**
051 * @return the given CatalogItem's name.
052 * @override Sometimes
053 */
054 public Object getValueAt(Object oData, int nIdx) {
055 return ((DataBasketEntry)oData).getSecondaryKey();
056 }
057 }