use of org.eclipse.scout.rt.client.ui.basic.table.HeaderCell in project scout.rt by eclipse.
the class AbstractColumn method decorateHeaderCell.
@Override
public void decorateHeaderCell() {
HeaderCell cell = m_headerCell;
decorateHeaderCellInternal(cell);
try {
interceptDecorateHeaderCell(cell);
if (getTable() != null && getTable().getColumnSet() != null) {
getTable().getColumnSet().updateColumn(this);
}
} catch (Exception e) {
LOG.warn("Error decorating header", e);
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.HeaderCell in project scout.rt by eclipse.
the class JsonTableTest method testColumnHeadersUpdatedEvent.
/**
* Sends header update event if header cell has changed, but only for visible columns.
*/
@Test
public void testColumnHeadersUpdatedEvent() throws JSONException {
TableWith3Cols table = new TableWith3Cols();
table.fill(2);
table.initTable();
table.resetColumns();
table.getColumnSet().getColumn(0).setDisplayable(false);
IColumn<?> column0 = table.getColumns().get(0);
IColumn<?> column1 = table.getColumns().get(1);
IJsonAdapter<? super TableWith3Cols> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
jsonTable.toJson();
// ----------
((HeaderCell) column0.getHeaderCell()).setText("newHeaderText");
table.getColumnSet().updateColumn(column0);
List<JsonEvent> responseEvents = JsonTestUtility.extractEventsFromResponse(m_uiSession.currentJsonResponse(), JsonTable.EVENT_COLUMN_HEADERS_UPDATED);
assertTrue(responseEvents.size() == 0);
((HeaderCell) column1.getHeaderCell()).setText("newHeaderText2");
table.getColumnSet().updateColumn(column1);
responseEvents = JsonTestUtility.extractEventsFromResponse(m_uiSession.currentJsonResponse(), JsonTable.EVENT_COLUMN_HEADERS_UPDATED);
assertTrue(responseEvents.size() == 1);
}
Aggregations