org.salespointframework.desktop.teds
Class AbstractTableEntryDescriptor

java.lang.Object
  extended by org.salespointframework.desktop.teds.AbstractTableEntryDescriptor
All Implemented Interfaces:
TableEntryDescriptor
Direct Known Subclasses:
DefaultCatalogItemDBETableEntryDescriptor, DefaultCatalogItemTED, DefaultCountingStockDBETableEntryDescriptor, DefaultLogEntryTED, DefaultStockItemTED, DefaultStoringStockDBETableEntryDescriptor, DefaultUserTED

public abstract class AbstractTableEntryDescriptor
extends java.lang.Object
implements TableEntryDescriptor

Abstract base implementation of TableEntryDescriptor.

This base implementations is useful when you want to define a TableEntryDescriptor that describes rows that are non-editable and use the default renderer for each cell, based on the cell value's class.

Since:
v2.0
Version:
2.0 27/07/1999
Author:
Steffen Zschaler
See Also:
AbstractTableModel

Constructor Summary
AbstractTableEntryDescriptor()
          Dummy constructor, does nothing but call super().
 
Method Summary
 boolean canSortByColumn(int nIdx)
          Returns false because AbstractTableEntryDescriptor does not allow sorting by column by default.
 javax.swing.table.TableCellEditor getCellEditor(int nIdx)
          Returns null to indicate that the default cell editor is to be used based on the cell value's class.
 javax.swing.table.TableCellRenderer getCellRenderer(int nIdx)
          Returns null to indicate that the default cell renderer is to be used based on the cell value's class.
 java.util.Comparator<java.lang.Object> getColumnOrder(int nIdx)
          Returns null because AbstractTableEntryDescriptor does not allow sorting by column by default.
 boolean isElementEditable(java.lang.Object oRecord, int nIdx)
          Returns false to indicate that no cell is editable in the entire table.
 void setValueAt(java.lang.Object oRecord, int nIdx, java.lang.Object oValue)
          Does nothing because AbstractTableEntryDescriptor does not allow editing by default.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.salespointframework.desktop.TableEntryDescriptor
getColumnClass, getColumnCount, getColumnName, getValueAt
 

Constructor Detail

AbstractTableEntryDescriptor

public AbstractTableEntryDescriptor()
Dummy constructor, does nothing but call super().

Method Detail

getCellRenderer

public javax.swing.table.TableCellRenderer getCellRenderer(int nIdx)
Returns null to indicate that the default cell renderer is to be used based on the cell value's class.

Specified by:
getCellRenderer in interface TableEntryDescriptor
Parameters:
nIdx - the index of the column for which to return the renderer. Indices run from 0 to getColumnCount() - 1.
Returns:
the cell renderer to be used for cells in the given column. You can return null to indicate that the default cell renderer for the column class should be used.

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int nIdx)
Returns null to indicate that the default cell editor is to be used based on the cell value's class.

Specified by:
getCellEditor in interface TableEntryDescriptor
Parameters:
nIdx - the index of the column for which to return the editor. Indices run from 0 to getColumnCount() - 1.
Returns:
the cell editor to be used for cells in the given column. You can return null to indicate that the default cell editor for the column class should be used.

isElementEditable

public boolean isElementEditable(java.lang.Object oRecord,
                                 int nIdx)
Returns false to indicate that no cell is editable in the entire table.

Specified by:
isElementEditable in interface TableEntryDescriptor
Parameters:
oRecord - the record for which to determine editability. The actual class depends on the AbstractTableModel you are working with. It will be declared in the documentation for the AbstractTableModel.getRecord(int) method of that class.
nIdx - the index of the column for which to determine editability. Indices run from 0 to getColumnCount() - 1.
Returns:
whether the given column is editable for the given record.

setValueAt

public void setValueAt(java.lang.Object oRecord,
                       int nIdx,
                       java.lang.Object oValue)
Does nothing because AbstractTableEntryDescriptor does not allow editing by default.

Specified by:
setValueAt in interface TableEntryDescriptor
Parameters:
oRecord - the record for which to determine the value. The actual class depends on the AbstractTableModel you are working with. It will be declared in the documentation for the AbstractTableModel.getRecord(int) method of that class.
nIdx - the index of the column for which to return the cell value. Indices run from 0 to getColumnCount() - 1.
oValue - the value to become the new value of the cell. The class of this object depends on the editor used for editing the cell. Normally, this will be determined by TableEntryDescriptor.getCellEditor(int).

canSortByColumn

public boolean canSortByColumn(int nIdx)
Returns false because AbstractTableEntryDescriptor does not allow sorting by column by default.

Specified by:
canSortByColumn in interface TableEntryDescriptor
Parameters:
nIdx - the index of the column concerned.
Returns:
whether or not records can be sorted by the specified column.

getColumnOrder

public java.util.Comparator<java.lang.Object> getColumnOrder(int nIdx)
Returns null because AbstractTableEntryDescriptor does not allow sorting by column by default.

Specified by:
getColumnOrder in interface TableEntryDescriptor
Parameters:
nIdx - the index of the column concerned.