use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithUntrimmedText2.
@Test
public void testLookupRowWithUntrimmedText2() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected boolean getConfiguredTrimText() {
return true;
}
};
column.setCodeTypeClass(TestCodeType.class);
final ITable table = new AbstractTable() {
@Override
protected void injectColumnsInternal(OrderedCollection<IColumn<?>> columns) {
columns.addFirst(column);
}
};
ITableRow row = table.addRow();
@SuppressWarnings("unchecked") IProposalField<Long> field = (IProposalField<Long>) column.prepareEditInternal(row);
field.getUIFacade().acceptProposalFromUI(" a ", false, false);
column.completeEdit(row, field);
assertEquals("a", column.getValue(row));
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithUntrimmedText1.
@Test
public void testLookupRowWithUntrimmedText1() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected boolean getConfiguredTrimText() {
return false;
}
};
column.setCodeTypeClass(TestCodeType.class);
final ITable table = new AbstractTable() {
@Override
protected void injectColumnsInternal(OrderedCollection<IColumn<?>> columns) {
columns.addFirst(column);
}
};
ITableRow row = table.addRow();
@SuppressWarnings("unchecked") IProposalField<Long> field = (IProposalField<Long>) column.prepareEditInternal(row);
field.getUIFacade().acceptProposalFromUI(" a ", false, true);
column.completeEdit(row, field);
assertEquals(" a ", column.getValue(row));
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithNullText.
@Test
public void testLookupRowWithNullText() throws Exception {
AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
};
column.setCodeTypeClass(TestCodeType.class);
column.setMandatory(true);
ITableRow row = Mockito.mock(ITableRow.class);
@SuppressWarnings("unchecked") IProposalField<Long> field = (IProposalField<Long>) column.prepareEditInternal(row);
field.getUIFacade().acceptProposalFromUI("", false, false);
assertEquals(null, field.getDisplayText());
assertEquals(null, field.getValue());
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class AbstractSmartColumnTest method testResetInvalidValue.
@Test
public void testResetInvalidValue() {
table.addRowsByArray(new Long[] { 3L });
ITableRow testRow = table.getRow(0);
parseAndSetInEditField(testRow, "invalid Text");
assertFalse(testRow.getCell(0).isContentValid());
parseAndSetInEditField(testRow, "Test");
assertEquals("Test", testRow.getCell(0).getText());
assertEquals(0L, testRow.getCell(0).getValue());
assertTrue(testRow.getCell(0).isContentValid());
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITableRow in project scout.rt by eclipse.
the class InternalTableRowTest method testCellChange.
@Test
public void testCellChange() {
TestTable table = new TestTable();
ITableRow row = table.createRow();
InternalTableRow ir = new InternalTableRow(table, row);
ir.setRowChanging(true);
ir.cellChanged(ir.getCell(0), ICell.TEXT_BIT);
assertEquals(1, ir.getUpdatedColumnIndexes().size());
assertEquals(Integer.valueOf(0), ir.getUpdatedColumnIndexes().iterator().next());
ir.setRowChanging(false);
}
Aggregations