Search in sources :

Example 1 with IIntegerField

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

the class AbstractIntegerColumnTest method testPrepareEditInternal.

@Test
public void testPrepareEditInternal() {
    AbstractIntegerColumn column = new AbstractIntegerColumn() {
    };
    column.setMandatory(true);
    ITableRow row = mock(ITableRow.class);
    IIntegerField field = (IIntegerField) column.prepareEditInternal(row);
    assertEquals("mandatory property to be progagated to field", column.isMandatory(), field.isMandatory());
}
Also used : IIntegerField(org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField) ITableRow(org.eclipse.scout.rt.client.ui.basic.table.ITableRow) Test(org.junit.Test)

Example 2 with IIntegerField

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

the class AbstractColumnTest method testCompleteEdit_ParsingError.

@Test
public void testCompleteEdit_ParsingError() {
    ParsingTestTable table = new ParsingTestTable();
    table.addRowsByArray(new Integer[] { 0 });
    IIntegerField field = new AbstractIntegerField() {
    };
    field.parseAndSetValue("invalid number");
    table.getIntTestColumn().completeEdit(table.getRow(0), field);
    ICell c = table.getCell(0, 0);
    assertEquals("invalid number", c.getText());
    assertEquals(0, c.getValue());
    assertNotNull(String.format("The invalid cell should have an error status: value '%s'", c.getValue(), c.getErrorStatus()));
}
Also used : IIntegerField(org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField) AbstractIntegerField(org.eclipse.scout.rt.client.ui.form.fields.integerfield.AbstractIntegerField) ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell) Test(org.junit.Test)

Aggregations

IIntegerField (org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField)2 Test (org.junit.Test)2 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)1 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)1 AbstractIntegerField (org.eclipse.scout.rt.client.ui.form.fields.integerfield.AbstractIntegerField)1