001 package users.swing; 002 003 import users.*; 004 005 import util.swing.*; 006 007 /** 008 * A {@link TableEntryDescriptor} that can be used with a {@link UserTableModel}. 009 * 010 * <p>There will be one column headed quot;Name". It will display the Users' names. 011 * 012 * @author Andreas Bartho 013 * @version 1.0 04/03/2003 014 * @since v3.1 015 */ 016 public class DefaultUserTED extends AbstractTableEntryDescriptor { 017 018 /** 019 * ID for serialization. 020 */ 021 private static final long serialVersionUID = -3704593812785143986L; 022 023 /** 024 * Creates a new DefaultUserTED. 025 */ 026 public DefaultUserTED() { 027 super(); 028 } 029 030 /** 031 * @return 1. 032 * @override Sometimes 033 */ 034 public int getColumnCount() { 035 return 1; 036 } 037 038 /** 039 * @return "Name" 040 * @override Sometimes 041 */ 042 public String getColumnName(int nIdx) { 043 return "Name"; 044 } 045 046 /** 047 * @return <code>String.class</code> 048 * @override Sometimes 049 */ 050 public Class<?> getColumnClass(int nIdx) { 051 return String.class; 052 } 053 054 /** 055 * @return the User's name 056 * @override Sometimes 057 */ 058 public Object getValueAt(Object oData, int nIdx) { 059 return ((User)oData).getName(); 060 } 061 062 }