use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class JsonOutline method detachDetailTable.
protected void detachDetailTable(IPage page) {
ITable table = page.getTable(false);
if (table != null) {
table.setProperty(JsonOutlineTable.PROP_PAGE, null);
IJsonAdapter<?> jsonTableAdapter = getGlobalAdapter(table);
if (jsonTableAdapter != null) {
m_jsonDetailTables.remove(jsonTableAdapter);
if (!jsonTableAdapter.isDisposed()) {
jsonTableAdapter.dispose();
}
}
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithTooLongText2.
@Test
public void testLookupRowWithTooLongText2() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected int getConfiguredMaxLength() {
return 8;
}
};
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("1234567890", false, false);
column.completeEdit(row, field);
assertEquals("12345678", column.getValue(row));
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithTooLongText1.
@Test
public void testLookupRowWithTooLongText1() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected int getConfiguredMaxLength() {
return 32;
}
};
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("1234567890", false, false);
column.completeEdit(row, field);
assertEquals("1234567890", column.getValue(row));
}
use of org.eclipse.scout.rt.client.ui.basic.table.ITable in project scout.rt by eclipse.
the class OrganizeColumnsFormRegressionTest method givenAProfilesTable.
private void givenAProfilesTable() {
ITable table = mock(ITable.class);
OrganizeColumnsForm form = new OrganizeColumnsForm(table);
profilesTable = form.getProfilesTableField().getTable();
profilesTable.addTableListener(new TableListener() {
@Override
public void tableChangedBatch(List<? extends TableEvent> batch) {
for (TableEvent e : batch) {
tableChanged(e);
}
}
@Override
public void tableChanged(TableEvent e) {
if (e.getType() == TableEvent.TYPE_REQUEST_FOCUS_IN_CELL) {
IColumn focusedColumn = CollectionUtility.firstElement(e.getColumns());
ITableRow focusedRow = CollectionUtility.firstElement(e.getRows());
if (focusedColumn.equals(profilesTable.getConfigNameColumn())) {
lastFocusedRowIndex.setValue(focusedRow.getRowIndex());
}
}
}
});
profilesTable.deselectAllRows();
}
Aggregations