Column<PropertyRecord, String> valueColumn = null;
// inline editing or not?
if(inlineEditing)
{
keyColumn = new Column<PropertyRecord, String>(new DefaultEditTextCell()) {
{
setFieldUpdater(new FieldUpdater<PropertyRecord, String>() {
@Override
public void update(int index, PropertyRecord object, String value) {
object.setKey(value);
presenter.onChangeProperty(reference, object);
}
});
}
@Override
public String getValue(PropertyRecord object) {
return object.getKey();
}
};
valueColumn = new Column<PropertyRecord, String>(new DefaultEditTextCell()) {
{
setFieldUpdater(new FieldUpdater<PropertyRecord, String>() {
@Override
public void update(int index, PropertyRecord object, String value) {
object.setValue(value);
presenter.onChangeProperty(reference, object);
}
});
}
@Override
public String getValue(PropertyRecord object) {
return object.getValue();
}
};
}
else
{
keyColumn = new TextColumn<PropertyRecord>() {
@Override
public String getValue(PropertyRecord object) {
return object.getKey();
}
};
valueColumn = new Column<PropertyRecord, String>(new ValueCell()) {
@Override
public String getValue(PropertyRecord object) {
return object.getValue();
}
};
}
// sorting
keyColumn.setSortable(true);
sortHandler.setComparator(keyColumn, new Comparator<PropertyRecord>() {
@Override
public int compare(PropertyRecord o1, PropertyRecord o2) {
return o1.getKey().compareTo(o2.getKey());
}
});
Column<PropertyRecord, String> bootColumn = new Column<PropertyRecord, String>(new DefaultEditTextCell()) {
{
setFieldUpdater(new FieldUpdater<PropertyRecord, String>() {
@Override
public void update(int index, PropertyRecord object, String value) {