Search in sources :

Example 1 with ParsingFailedStatus

use of org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus in project scout.rt by eclipse.

the class JsonValueField method handleUiErrorStatusChange.

protected void handleUiErrorStatusChange(JSONObject data) {
    JSONObject jsonStatus = data.optJSONObject(IValueField.PROP_ERROR_STATUS);
    addPropertyEventFilterCondition(IValueField.PROP_ERROR_STATUS, jsonStatus);
    ParsingFailedStatus status = null;
    if (jsonStatus != null) {
        status = new ParsingFailedStatus(JsonStatus.toScoutObject(jsonStatus), getModel().getDisplayText());
    }
    setErrorStatusFromUI(status);
}
Also used : JSONObject(org.json.JSONObject) ParsingFailedStatus(org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus)

Example 2 with ParsingFailedStatus

use of org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus in project scout.rt by eclipse.

the class AbstractDateColumnTest method setParseErrorInUI.

private void setParseErrorInUI(ITableRow row, AbstractDateColumn column) {
    AbstractDateField field = (AbstractDateField) column.prepareEdit(row);
    field.getUIFacade().setDisplayTextFromUI("invalid");
    field.getUIFacade().setErrorStatusFromUI(new ParsingFailedStatus("Parsing failed", "invalid"));
    column.completeEdit(row, field);
}
Also used : AbstractDateField(org.eclipse.scout.rt.client.ui.form.fields.datefield.AbstractDateField) ParsingFailedStatus(org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus)

Example 3 with ParsingFailedStatus

use of org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus in project scout.rt by eclipse.

the class CellTest method testAddRemoveMultistatus.

/**
 * {@link Cell#setErrorStatus(org.eclipse.scout.rt.platform.status.IStatus)}
 */
@Test
public void testAddRemoveMultistatus() {
    Cell c = new Cell();
    ParsingFailedStatus errorStatus = new ParsingFailedStatus("failed", "rawString");
    MultiStatus ms = new MultiStatus();
    ms.add(errorStatus);
    c.addErrorStatuses(ms.getChildren());
    c.removeErrorStatus(ParsingFailedStatus.class);
    assertNull(c.getErrorStatus());
}
Also used : MultiStatus(org.eclipse.scout.rt.platform.status.MultiStatus) ParsingFailedStatus(org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus) Test(org.junit.Test)

Aggregations

ParsingFailedStatus (org.eclipse.scout.rt.client.ui.form.fields.ParsingFailedStatus)3 AbstractDateField (org.eclipse.scout.rt.client.ui.form.fields.datefield.AbstractDateField)1 MultiStatus (org.eclipse.scout.rt.platform.status.MultiStatus)1 JSONObject (org.json.JSONObject)1 Test (org.junit.Test)1