public static class UiBinding.BoundTableModel extends AbstractTableModel
Constructor and Description |
---|
BoundTableModel(CollectionProperty objectProperty,
PropertyBusinessObject prototype)
Creates a table model with the business objects
|
BoundTableModel(List<? extends PropertyBusinessObject> objects,
PropertyBusinessObject prototype)
Creates a table model with the business objects
|
Modifier and Type | Method and Description |
---|---|
void |
addDataChangeListener(DataChangedListener d)
Adds a listener to the data changed event
|
void |
addRow(int index,
PropertyBusinessObject b)
Adds a new business object to the table
|
void |
excludeProperty(PropertyBase b)
The properties that are ignored
|
Class |
getCellType(int row,
int column)
Allows the table to hint the class type of a specific cell
|
int |
getColumnCount()
Returns the number of columns in the table
|
String |
getColumnName(int i)
Returns the name of the column at the given offset
|
String[] |
getMultipleChoiceOptions(int row,
int column)
Allows the table cell to feature multiple choice for a specific entry
|
int |
getRowCount()
Returns the number of rows in the table
|
Constraint |
getValidationConstraint(int row,
int column)
If the cell has a validation constraint it's returned here
|
Object |
getValueAt(int row,
int column)
Returns the value of the cell at the given location
|
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at the given location is an editable cell
|
void |
removeDataChangeListener(DataChangedListener d)
Removes a listener to the data changed event
|
void |
removeRow(int index)
Removes the row at the given index
|
void |
setColumnOrder(PropertyBase... columnOrder)
Sets the order of the columns explicitly
|
void |
setEditable(PropertyBase pb,
boolean editable)
Makes the property editable or uneditable
|
void |
setMultipleChoiceOptions(PropertyBase prop,
String... values)
Sets the multiple choice option for a string entry, this is useful
if a string property can have one of several values.
|
void |
setValidationConstraint(PropertyBase prop,
Constraint c)
Sets a validator constraint on the table
|
void |
setValueAt(int row,
int column,
Object o)
Sets the value of the cell at the given location
|
getValidator, setValidator
public BoundTableModel(List<? extends PropertyBusinessObject> objects, PropertyBusinessObject prototype)
objects
- the objects of the modelprototype
- the type by which we determine the structure of the tablepublic BoundTableModel(CollectionProperty objectProperty, PropertyBusinessObject prototype)
objectProperty
- the objects of the modelprototype
- the type by which we determine the structure of the tablepublic void excludeProperty(PropertyBase b)
b
- the property to ignorepublic void setColumnOrder(PropertyBase... columnOrder)
columnOrder
- the order of the columns based on the prototypepublic void setEditable(PropertyBase pb, boolean editable)
pb
- the property baseeditable
- true for editable (the default)public int getRowCount()
public void addRow(int index, PropertyBusinessObject b)
index
- the index of the additionb
- the business objectpublic void removeRow(int index)
index
- the position in the tablepublic int getColumnCount()
public String getColumnName(int i)
TableModel
i
- the offset for the column namepublic boolean isCellEditable(int row, int column)
TableModel
row
- the cell rowcolumn
- the cell columnpublic Object getValueAt(int row, int column)
TableModel
row
- the cell rowcolumn
- the cell columnpublic Class getCellType(int row, int column)
AbstractTableModel
getCellType
in class AbstractTableModel
row
- the row in the tablecolumn
- the columnpublic String[] getMultipleChoiceOptions(int row, int column)
getMultipleChoiceOptions
in class AbstractTableModel
row
- the row in the tablecolumn
- the columnpublic void setMultipleChoiceOptions(PropertyBase prop, String... values)
prop
- the propertyvalues
- the supported valuespublic Constraint getValidationConstraint(int row, int column)
getValidationConstraint
in class AbstractTableModel
row
- the rowcolumn
- the column for the cellpublic void setValidationConstraint(PropertyBase prop, Constraint c)
prop
- the property matching the constraintc
- the constraint valuepublic void setValueAt(int row, int column, Object o)
TableModel
row
- the cell rowcolumn
- the cell columno
- the value of the cell at the given locationpublic void addDataChangeListener(DataChangedListener d)
TableModel
d
- the new listenerpublic void removeDataChangeListener(DataChangedListener d)
TableModel
d
- the listener to remove