Search in sources :

Example 26 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class ColumnMandatoryTest method testSettingProperty.

/**
 * Tests setting the mandatory property
 */
@Test
public void testSettingProperty() {
    MandatoryTestTable testTable = new MandatoryTestTable();
    final NonMandatoryTestColumn column = testTable.getNonMandatoryTestColumn();
    column.setMandatory(true);
    testTable.addRowByArray(getEmptyTestRow());
    final Cell cell = (Cell) testTable.getCell(0, 0);
    assertFalse(cell.isContentValid());
    assertTrue(column.isMandatory());
}
Also used : NonMandatoryTestColumn(org.eclipse.scout.rt.client.ui.basic.table.ColumnMandatoryTest.MandatoryTestTable.NonMandatoryTestColumn) Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) Test(org.junit.Test)

Example 27 with Cell

use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.

the class ColumnMandatoryTest method testFieldMandatoryInColumn.

/**
 * Tests mandatory column with empty value
 */
@Test
public void testFieldMandatoryInColumn() {
    MandatoryTestTable testTable = new MandatoryTestTable();
    testTable.addRowByArray(getEmptyTestRow());
    final Cell cell = (Cell) testTable.getCell(0, 0);
    assertFalse(cell.isContentValid());
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) Test(org.junit.Test)

Aggregations

Cell (org.eclipse.scout.rt.client.ui.basic.cell.Cell)27 Test (org.junit.Test)10 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)9 HeaderCell (org.eclipse.scout.rt.client.ui.basic.table.HeaderCell)5 IHeaderCell (org.eclipse.scout.rt.client.ui.basic.table.IHeaderCell)5 DecimalFormat (java.text.DecimalFormat)4 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)4 IValidateContentDescriptor (org.eclipse.scout.rt.client.ui.form.fields.IValidateContentDescriptor)4 Locale (java.util.Locale)3 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)2 BigDecimal (java.math.BigDecimal)1 BigInteger (java.math.BigInteger)1 NonMandatoryTestColumn (org.eclipse.scout.rt.client.ui.basic.table.ColumnMandatoryTest.MandatoryTestTable.NonMandatoryTestColumn)1 ITableRowCustomValueContributor (org.eclipse.scout.rt.client.ui.basic.table.ITableRowCustomValueContributor)1 InternalTableRow (org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow)1 IValueField (org.eclipse.scout.rt.client.ui.form.fields.IValueField)1 ValidationFailedStatus (org.eclipse.scout.rt.client.ui.form.fields.ValidationFailedStatus)1 NumberFormatProvider (org.eclipse.scout.rt.platform.util.NumberFormatProvider)1