use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractIntegerColumnTest method testFormattingInDecorateCellInternal.
@Test
public void testFormattingInDecorateCellInternal() {
ITableRow row = Mockito.mock(ITableRow.class);
Cell cell = new Cell();
Integer testValue = Integer.valueOf(-123456789);
cell.setValue(testValue);
for (Locale locale : DecimalFormat.getAvailableLocales()) {
DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(locale);
df.applyPattern(getFormat().toPattern());
setFormat(df);
updateDisplayText(row, cell);
assertEquals("cell text not formatted as expected", df.format(testValue), cell.getText());
}
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractLongColumnTest method testFormattingInDecorateCellInternal.
@Test
public void testFormattingInDecorateCellInternal() {
ITableRow row = mock(ITableRow.class);
Cell cell = new Cell();
Long testValue = Long.valueOf(-123456789);
cell.setValue(testValue);
for (Locale locale : DecimalFormat.getAvailableLocales()) {
DecimalFormat df = (DecimalFormat) DecimalFormat.getInstance(locale);
df.applyPattern(getFormat().toPattern());
setFormat(df);
updateDisplayText(row, cell);
assertEquals("cell text not formatted as expected", df.format(testValue), cell.getText());
}
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class TableFieldTest method testErrorColumn_Visible.
/**
* Tests that an invisible displayable column is shown, if there is an error.
*/
@Test
public void testErrorColumn_Visible() {
P_TableField tableField = createTableField(false);
tableField.getTable().addRowByArray(TEST_ROW);
Cell cell = (Cell) tableField.getTable().getCell(0, 1);
cell.setEditable(true);
tableField.getTable().getStringColumn().setVisible(false);
cell.addErrorStatus("ErrorX");
IValidateContentDescriptor desc = tableField.validateContent();
assertTrue(tableField.getTable().getStringColumn().isVisible());
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractTable method decorateCell.
@Override
public final void decorateCell(ITableRow row, IColumn<?> col) {
Cell cell = row.getCellForUpdate(col.getColumnIndex());
decorateCellInternal(cell, row, col);
try {
interceptDecorateCell(cell, row, col);
} catch (Exception e) {
BEANS.get(ExceptionHandler.class).handle(e);
}
}
use of org.eclipse.scout.rt.client.ui.basic.cell.Cell in project scout.rt by eclipse.
the class AbstractColumn method decorateCell.
@Override
public void decorateCell(ITableRow row) {
Cell cell = row.getCellForUpdate(getColumnIndex());
decorateCellInternal(cell, row);
try {
interceptDecorateCell(cell, row);
} catch (RuntimeException e) {
LOG.warn("Exception decorating cell", e);
}
}
Aggregations