001 package users.swing; 002 003 import data.*; 004 import users.*; 005 006 import util.swing.*; 007 008 /** 009 * A {@link TableEntryDescriptor} that can be used with a {@link UserTableModel}. 010 * 011 * <p>There will be one column headed quot;Name". It will display the Users' names. 012 * 013 * @author Andreas Bartho 014 * @version 1.0 04/03/2003 015 * @since v3.1 016 */ 017 public class DefaultUserTED extends AbstractTableEntryDescriptor { 018 019 /** 020 * Creates a new DefaultUserTED. 021 */ 022 public DefaultUserTED() { 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 User's name 052 * @override Sometimes 053 */ 054 public Object getValueAt(Object oData, int nIdx) { 055 return ((User)oData).getName(); 056 } 057 058 }