use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractTableFieldTest method setUp.
@Before
public void setUp() {
for (int i = 0; i < 10; i++) {
ITableRow row = getTable().createRow();
getTable().getIntegerColumn().setValue(row, i);
getTable().getLongColumn().setValue(row, Long.valueOf(i * 2));
getTable().getString1Column().setValue(row, i + ". row");
getTable().getString2Column().setValue(row, getTextFor(i, " "));
getTable().getString3Column().setValue(row, getTextFor(i, " "));
getTable().getString4Column().setValue(row, getTextFor(i, "\n"));
getTable().getBigDecimalColumn().setValue(row, FAR_BELOW_ZERO.add(BigDecimal.valueOf(1.11).multiply(BigDecimal.valueOf(i))));
getTable().addRow(row);
getTable().selectAllRows();
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class TableFieldTest method addNewTableRow.
private void addNewTableRow(P_TableField tableField) {
ITableRow newRow = tableField.getTable().createRow();
tableField.getTable().getKeyColumn().setValue(newRow, 4);
tableField.getTable().getHiddenColumn().setValue(newRow, true);
tableField.getTable().getStringColumn().setValue(newRow, "Sit");
tableField.getTable().addRow(newRow);
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class TableFieldTest method updateThirdRow.
private void updateThirdRow(P_TableField tableField) {
ITableRow updatedRow = tableField.getTable().getRow(2);
updatedRow.getCellForUpdate(1).setValue("Amet");
updatedRow.getCellForUpdate(2).setValue(true);
tableField.getTable().updateRow(updatedRow);
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class JsonCellToJsonTest method testDateColumn_jsonDatePattern.
/**
* Don't send value and text if they are equal. They may be equal if the date column uses the same pattern as
* {@link JsonDate}.
*/
@Test
public void testDateColumn_jsonDatePattern() throws JSONException {
TableWithDateColumn table = new TableWithDateColumn();
table.initTable();
ITableRow row = table.addRow(table.createRow());
table.getColumn().setFormat(JsonDate.JSON_PATTERN_DATE_ONLY);
table.getColumn().setValue(row, DateUtility.parse("01.01.2015", "dd.MM.yyyy"));
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
Object jsonObj = jsonTable.cellToJson(row, table.getColumn());
assertTrue(jsonObj instanceof String);
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class JsonCellToJsonTest method testLongColumn.
/**
* Don't send value and text if they are equal.
*/
@Test
public void testLongColumn() throws JSONException {
TableWithLongColumn table = new TableWithLongColumn();
table.initTable();
ITableRow row = table.addRow(table.createRow());
table.getColumn().setValue(row, 15L);
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
JSONObject jsonObj = (JSONObject) jsonTable.cellToJson(row, table.getColumn());
Assert.assertEquals("15", jsonObj.get("text"));
assertNull(jsonObj.opt("value"));
}
Aggregations