|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.richclient.table.support.GlazedTableModel.DefaultAdvancedTableFormat
protected class GlazedTableModel.DefaultAdvancedTableFormat
This inner class can be used by derived implementations to use an AdvancedTableFormat instead of the default
WritableTableFormat created by GlazedTableModel.createTableFormat()
.
If a prototype value is provided (see setPrototypeValue(Object)
, then the default implementation of
getColumnClass will inspect the prototype object to determine the Class of the object in that column (by looking
at the type of the property in that column). If no prototype is provided, then getColumnClass will inspect the
current table data in order to determine the class of object in that column. If there are no non-null values in
the column, then getColumnClass will return Object.class, which is not very usable. In that case, you should
probably override getColumnClass(int)
.
You can specify individual comparators for columns using setComparator(int, Comparator)
. For any column
that doesn't have a comparator installed, a default comparable comparator will be handed out by
getColumnComparator(int)
.
Constructor Summary | |
---|---|
GlazedTableModel.DefaultAdvancedTableFormat()
|
Method Summary | |
---|---|
Class |
getColumnClass(int column)
Returns the class for all the cell values in the column. |
Comparator |
getColumnComparator(int column)
Get the comparator to use on values in the given column. |
int |
getColumnCount()
|
String |
getColumnName(int column)
|
Object |
getColumnValue(Object row,
int column)
|
void |
setComparator(int column,
Comparator comparator)
Set the comparator to use for a given column. |
void |
setPrototypeValue(Object prototype)
Set the prototype value from which to determine column classes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GlazedTableModel.DefaultAdvancedTableFormat()
Method Detail |
---|
public int getColumnCount()
getColumnCount
in interface ca.odell.glazedlists.gui.TableFormat
public String getColumnName(int column)
getColumnName
in interface ca.odell.glazedlists.gui.TableFormat
public Object getColumnValue(Object row, int column)
getColumnValue
in interface ca.odell.glazedlists.gui.TableFormat
public Class getColumnClass(int column)
Object.class
is returned.
getColumnClass
in interface ca.odell.glazedlists.gui.AdvancedTableFormat
column
- The index of the column being edited.
public Comparator getColumnComparator(int column)
setComparator(int, Comparator)
, then it is returned. If not, then a default comparator
(assuming the objects implement Comparable) is returned.
getColumnComparator
in interface ca.odell.glazedlists.gui.AdvancedTableFormat
column
- the column
Comparator
to use or null
for an unsortable column.public void setComparator(int column, Comparator comparator)
column
- The column for which the compartor is to be usedcomparator
- The comparator to installpublic void setPrototypeValue(Object prototype)
getColumnClass(int)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |