SalesPoint Framework v3.0

util.swing
Class AbstractTableEntryDescriptor

java.lang.Object
  |
  +--util.swing.AbstractTableEntryDescriptor
Direct Known Subclasses:
DefaultCatalogItemDBETableEntryDescriptor, DefaultCatalogItemTED, DefaultCountingStockDBETableEntryDescriptor, DefaultLogEntryTED, DefaultStockItemTED, DefaultStoringStockDBETableEntryDescriptor

public abstract class AbstractTableEntryDescriptor
extends 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, Serialized Form

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.
 TableCellEditor getCellEditor(int nIdx)
          Returns null to indicate that the default cell editor is to be used based on the cell value's class.
 TableCellRenderer getCellRenderer(int nIdx)
          Returns null to indicate that the default cell renderer is to be used based on the cell value's class.
 Comparator getColumnOrder(int nIdx)
          Returns null because AbstractTableEntryDescriptor does not allow sorting by column by default.
 boolean isElementEditable(Object oRecord, int nIdx)
          Returns false to indicate that no cell is editable in the entire table.
 void setValueAt(Object oRecord, int nIdx, 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
 

Constructor Detail

AbstractTableEntryDescriptor

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

getCellRenderer

public TableCellRenderer getCellRenderer(int nIdx)
Returns null to indicate that the default cell renderer is to be used based on the cell value's class.
Override:
Sometimes.
Override this method if you want to define specialized cell renderers for certain columns.
Specified by:
getCellRenderer in interface TableEntryDescriptor

getCellEditor

public TableCellEditor getCellEditor(int nIdx)
Returns null to indicate that the default cell editor is to be used based on the cell value's class.
Override:
Sometimes.
Override this method if you want to define specialized cell editors for certain columns. Note that you will also have to override isElementEditable(java.lang.Object, int) and setValueAt(java.lang.Object, int, java.lang.Object) for complete editing support.
Specified by:
getCellEditor in interface TableEntryDescriptor

isElementEditable

public boolean isElementEditable(Object oRecord,
                                 int nIdx)
Returns false to indicate that no cell is editable in the entire table.
Override:
Sometimes.
Override this method if you want to allow editing for certain cells. The actual class of the record passed as oRecord depends on the TableModel with which you work. See AbstractTableModel.getRecord(int) in the concrete TableModel for a description. Note that you will also have to override setValueAt(java.lang.Object, int, java.lang.Object) for complete editing support. It is also recommended that you override getCellEditor(int) if you override this method.
Specified by:
isElementEditable in interface TableEntryDescriptor

setValueAt

public void setValueAt(Object oRecord,
                       int nIdx,
                       Object oValue)
Does nothing because AbstractTableEntryDescriptor does not allow editing by default.
Override:
Sometimes.
Override this method if you want to allow editing for certain cells. The actual class of the record passed as oRecord depends on the TableModel with which you work. See AbstractTableModel.getRecord(int) in the concrete TableModel for a description. Note that you will also have to override isElementEditable(java.lang.Object, int) for complete editing support. It is also recommended that you override getCellEditor(int) if you override this method.
Specified by:
setValueAt in interface TableEntryDescriptor

canSortByColumn

public boolean canSortByColumn(int nIdx)
Returns false because AbstractTableEntryDescriptor does not allow sorting by column by default.
Override:
Sometimes.
Override this method if you want to support sorting by column
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 Comparator getColumnOrder(int nIdx)
Returns null because AbstractTableEntryDescriptor does not allow sorting by column by default.
Override:
Sometimes.
Override this method if you want to support sorting by column
Specified by:
getColumnOrder in interface TableEntryDescriptor
Parameters:
nIdx - the index of the column concerned.

SalesPoint Framework v3.0