Search in sources :

Example 1 with ICell

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();
}
Also used : JsonCell(org.eclipse.scout.rt.ui.html.json.basic.cell.JsonCell) ICellValueReader(org.eclipse.scout.rt.ui.html.json.basic.cell.ICellValueReader) ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell)

Example 2 with ICell

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));
    }
}
Also used : Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell)

Example 3 with ICell

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());
}
Also used : ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell) Test(org.junit.Test)

Example 4 with ICell

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());
}
Also used : ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell) Test(org.junit.Test)

Example 5 with ICell

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());
}
Also used : ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell) Test(org.junit.Test)

Aggregations

ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)23 Test (org.junit.Test)15 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)4 Date (java.util.Date)3 SimpleDateFormat (java.text.SimpleDateFormat)2 HashSet (java.util.HashSet)2 Cell (org.eclipse.scout.rt.client.ui.basic.cell.Cell)2 ArrayList (java.util.ArrayList)1 TestDateColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractDateColumnTest.TestTable.TestDateColumn)1 AbstractIntegerField (org.eclipse.scout.rt.client.ui.form.fields.integerfield.AbstractIntegerField)1 IIntegerField (org.eclipse.scout.rt.client.ui.form.fields.integerfield.IIntegerField)1 IMixedSmartField (org.eclipse.scout.rt.client.ui.form.fields.smartfield.IMixedSmartField)1 PlatformError (org.eclipse.scout.rt.platform.exception.PlatformError)1 IMultiStatus (org.eclipse.scout.rt.platform.status.IMultiStatus)1 ILookupRow (org.eclipse.scout.rt.shared.services.lookup.ILookupRow)1 ICellValueReader (org.eclipse.scout.rt.ui.html.json.basic.cell.ICellValueReader)1 JsonCell (org.eclipse.scout.rt.ui.html.json.basic.cell.JsonCell)1