use of org.eclipse.scout.rt.client.ui.basic.cell.ICell in project scout.rt by eclipse.
the class JsonTable method cellToJson.
protected Object cellToJson(final ITableRow row, final IColumn column) {
ICell cell = row.getCell(column);
JsonColumn<?> jsonColumn = m_jsonColumns.get(column);
ICellValueReader reader = new TableCellValueReader(jsonColumn, cell);
return new JsonCell(cell, this, reader).toJsonOrString();
}
use of org.eclipse.scout.rt.client.ui.basic.cell.ICell in project scout.rt by eclipse.
the class TableRow method setCell.
@Override
public void setCell(int columnIndex, ICell cell) {
if (cell != null) {
getCellForUpdate(columnIndex);
m_cells.set(columnIndex, new Cell(null, cell));
}
}
use of org.eclipse.scout.rt.client.ui.basic.cell.ICell in project scout.rt by eclipse.
the class AbstractColumnTest method testNoInitialDecoration.
@Test
public void testNoInitialDecoration() throws Exception {
TestVetoTable table = new TestVetoTable();
table.addRowsByArray(new String[] { "a" });
ICell c0 = table.getCell(0, 0);
assertEquals(null, c0.getCssClass());
assertEquals(1, table.getValidateTestColumn().getDecorateCount());
}
use of org.eclipse.scout.rt.client.ui.basic.cell.ICell in project scout.rt by eclipse.
the class AbstractColumnTest method testValidColumn.
/**
* Test that value, text and error status are correct after adding a valid row to a table with
* {@link AbstractTable#addRowByArray(Object)}
*/
@Test
public void testValidColumn() {
TestTable table = new TestTable();
table.addRowsByArray(new String[] { VALID });
ICell c0 = table.getCell(0, 0);
assertTrue(table.getValidateTestColumn().isContentValid(table.getRow(0)));
assertNoErrorStatus(c0);
assertEquals(VALID, c0.getValue());
assertEquals(VALID, c0.getText());
}
use of org.eclipse.scout.rt.client.ui.basic.cell.ICell in project scout.rt by eclipse.
the class AbstractColumnTest method testResetValidationError.
/**
* Test that setting a valid value in an initially invalid table resets the error.
*/
@Test
public void testResetValidationError() {
TestTable table = new TestTable();
table.addRowsByArray(new String[] { INVALID });
table.getValidateTestColumn().setValue(0, VALID);
ICell c0 = table.getCell(0, 0);
assertTrue(table.getValidateTestColumn().isContentValid(table.getRow(0)));
assertNoErrorStatus(c0);
assertEquals(VALID, c0.getValue());
assertEquals(VALID, c0.getText());
}
Aggregations