001 package org.springframework.richclient.widget.table;
002
003 import javax.swing.table.TableCellEditor;
004 import javax.swing.table.TableCellRenderer;
005 import java.util.Comparator;
006
007
008 /**
009 * TableDescription
010 */
011 public interface TableDescription
012 {
013 /**
014 * @return Type van row objects
015 */
016 Class getDataType();
017
018 /**
019 * De properties to be included in the text filter
020 */
021 String[] getPropertiesInTextFilter();
022
023 /**
024 * Datatype for a column
025 */
026 Class getType(int propertyIndex);
027
028 /**
029 * Column header.
030 */
031 String getHeader(int propertyIndex);
032
033 /**
034 * Value of a columnn for a certain row object
035 */
036 Object getValue(Object rowObject, int propertyIndex);
037
038 /**
039 * Sets the value of a column of a certain row object
040 */
041 void setValue(Object rowObject, int propertyIndex, Object newValue);
042
043 /**
044 * Maximum width for a column
045 */
046 int getMaxColumnWidth(int propertyIndex);
047
048 /**
049 * Minimum width for a column
050 */
051 int getMinColumnWidth(int propertyIndex);
052
053 /**
054 * If the column is resizable
055 */
056 boolean isResizable(int propertyIndex);
057
058 /**
059 * The column renderer for a column
060 */
061 TableCellRenderer getColumnRenderer(int propertyIndex);
062
063 /**
064 * The cell editorr for a column
065 */
066 TableCellEditor getColumnEditor(int propertyIndex);
067
068 /**
069 * Whether this column is a selection column
070 */
071 boolean isSelectColumn(int propertyIndex);
072
073 /**
074 * The comparator for a column
075 */
076 Comparator getColumnComparator(int propertyIndex);
077
078 /**
079 * The default comparator
080 */
081 Comparator getDefaultComparator();
082
083 /**
084 * Returns the column count
085 */
086 int getColumnCount();
087
088 /**
089 * @return TRUE if the table has a selection column
090 */
091 boolean hasSelectColumn();
092
093 /**
094 * Whether the column is initially visible or not
095 */
096 boolean isVisible(int propertyIndex);
097
098 }