use of org.eclipse.scout.rt.client.ui.form.fields.IValueField in project scout.rt by eclipse.
the class AbstractColumn method editorValueToCell.
/**
* Map the values of a cell to the editing form field. The default implementation assumes a value field.
*
* @throws ProcessingException
* if the field is not a value field
*/
protected void editorValueToCell(ITableRow row, IFormField editorField) {
if (!(editorField instanceof IValueField<?>)) {
throw new ProcessingException("Expected a value field.");
} else {
@SuppressWarnings("unchecked") IValueField<VALUE> valueField = (IValueField<VALUE>) editorField;
LOG.debug("complete edit: [value={}, text={}, status={}]", valueField.getValue(), valueField.getDisplayText(), valueField.getErrorStatus());
String cellAction = "";
Cell cell = row.getCellForUpdate(this);
if (!contentEquals(cell, valueField)) {
// remove existing validation and parsing error (but don't remove other possible error-statuses)
cell.removeErrorStatus(ValidationFailedStatus.class);
cell.removeErrorStatus(ParsingFailedStatus.class);
if (valueField.getErrorStatus() == null) {
parseValueAndSet(row, valueField.getValue(), true);
cellAction = "parseAndSetValue";
} else {
cell.setText(valueField.getDisplayText());
cell.addErrorStatuses(valueField.getErrorStatus().getChildren());
cellAction = "setText/addErrorStatuses";
}
}
LOG.debug("cell updated: [value={}, text={}, status={}, cellAction={}]", cell.getValue(), cell.getText(), cell.getErrorStatus(), cellAction);
}
}
use of org.eclipse.scout.rt.client.ui.form.fields.IValueField in project scout.rt by eclipse.
the class FindFieldByXmlIdsVisitor method visitField.
@Override
public boolean visitField(IFormField field, int level, int fieldIndex) {
int fieldIdRank = getFieldIdRank(field);
if (fieldIdRank > 0) {
int enclosingFieldPathRank = getEnclosingFieldPathRank(field);
CompositeObject key;
if (field instanceof IValueField) {
key = new CompositeObject(fieldIdRank, enclosingFieldPathRank, 2);
} else if (!(field instanceof ICompositeField)) {
key = new CompositeObject(fieldIdRank, enclosingFieldPathRank, 1);
} else {
key = new CompositeObject(fieldIdRank, enclosingFieldPathRank, 0);
}
if (m_prioMap.containsKey(key)) {
m_ambiguousFieldKeys.add(key);
} else {
m_prioMap.put(key, field);
}
}
return true;
}
Aggregations