|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.table.model.AbstractColumn
de.jaret.util.ui.table.model.PropCol
public class PropCol
Column implementation for the jaret table using reflection (getPropName, setPropName) to retrieve the column value. Does not support listening for property changes on the underlying POJO (But will fire a valueChanged if the model is changed by setValue). Supports property paths and an optional accessor (IPropColAccessor).
| Field Summary | |
|---|---|
protected IPropColAccessor |
_accessor
optional accessor. |
protected java.lang.Class<?> |
_contentClass
content class if specified directly. |
protected boolean |
_editable
true if the column is editable. |
protected java.lang.String |
_headerLabel
header label string. |
protected java.lang.String |
_id
id string. |
protected java.lang.String |
_prop
name of the mapped property (or path separeted by dots). |
protected java.lang.String[] |
_propPath
array of property names parsed from the property. |
protected boolean |
_supportSorting
true if the col should be able to sort the table. |
| Fields inherited from class de.jaret.util.ui.table.model.AbstractColumn |
|---|
_listeners |
| Constructor Summary | |
|---|---|
PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop)
Construct the column. |
|
PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop,
java.lang.Class<?> contentClass)
Construct the column. |
|
PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop,
java.lang.Class<?> contentClass,
IPropColAccessor accessor)
Construct the column. |
|
| Method Summary | |
|---|---|
int |
compare(IRow r1,
IRow r2)
Sorting default behaviour: compare toString(). |
java.lang.Class<?> |
getContentClass()
To allow null values as column value and to support cell editing and displaying a column may support this method for supplying the information. |
java.lang.Class<?> |
getContentClass(IRow row)
Default implementation: no difference to getContentClass(). |
java.lang.String |
getHeaderLabel()
Return a textual label to be displayed as the column header label. |
java.lang.String |
getId()
Id is used for storing the column width. |
java.lang.Object |
getValue(IRow row)
Retrieve the value of the column for the given row. |
boolean |
isEditable()
Deafult: cols are aditable. |
protected boolean |
isRealModification(java.lang.Object o1,
java.lang.Object o2)
Check whether there is a real modification between two (possible null) objects. |
void |
setEditable(boolean editable)
Set whether the column should be editable. |
void |
setSupportSorting(boolean supportSorting)
Set whether the column should support sorting. |
void |
setValue(IRow row,
java.lang.Object value)
Set the value of the coloumn for a given row. |
boolean |
supportsSorting()
Check whether the column supports sorting. |
| Methods inherited from class de.jaret.util.ui.table.model.AbstractColumn |
|---|
addColumnListener, displayHeader, fireValueChanged, isEditable, remColumnListener |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.jaret.util.ui.table.model.IColumn |
|---|
addColumnListener, displayHeader, isEditable, remColumnListener |
| Methods inherited from interface java.util.Comparator |
|---|
equals |
| Field Detail |
|---|
protected java.lang.String _id
protected java.lang.String _headerLabel
protected java.lang.String _prop
protected java.lang.String[] _propPath
protected boolean _supportSorting
protected boolean _editable
protected java.lang.Class<?> _contentClass
protected IPropColAccessor _accessor
| Constructor Detail |
|---|
public PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop,
java.lang.Class<?> contentClass,
IPropColAccessor accessor)
id - id of the columnlabel - header labelprop - property name (usually starting with a capital letter or path)contentClass - class of the objects held by the columnaccessor - optinal accessor to be invoked on the property to retrive/set the value
public PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop,
java.lang.Class<?> contentClass)
id - id of the columnlabel - header labelprop - property name (usually starting with a capital letter or path)contentClass - class of the objects held by the column
public PropCol(java.lang.String id,
java.lang.String label,
java.lang.String prop)
id - id of the columnlabel - header labelprop - property name (usually starting with a capital letter or path)| Method Detail |
|---|
public java.lang.String getId()
getId in interface IColumnpublic java.lang.String getHeaderLabel()
getHeaderLabel in interface IColumnpublic java.lang.Object getValue(IRow row)
getValue in interface IColumnrow - the row
public java.lang.Class<?> getContentClass(IRow row)
getContentClass in interface IColumngetContentClass in class AbstractColumnrow - row of which to get the content class
protected boolean isRealModification(java.lang.Object o1,
java.lang.Object o2)
o1 - object1o2 - object 2
public void setValue(IRow row,
java.lang.Object value)
setValue in interface IColumnrow - the rowvalue - value to set
public int compare(IRow r1,
IRow r2)
toString().
compare in interface java.util.Comparator<IRow>public boolean supportsSorting()
supportsSorting in interface IColumnpublic void setSupportSorting(boolean supportSorting)
supportSorting - true if sorting should be supportedpublic java.lang.Class<?> getContentClass()
getContentClass in interface IColumnpublic boolean isEditable()
isEditable in interface IColumnisEditable in class AbstractColumnpublic void setEditable(boolean editable)
editable - true for allow edit
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||