Search in sources :

Example 1 with HeaderCell

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);
    }
}
Also used : IHeaderCell(org.eclipse.scout.rt.client.ui.basic.table.IHeaderCell) HeaderCell(org.eclipse.scout.rt.client.ui.basic.table.HeaderCell) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException)

Example 2 with HeaderCell

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);
}
Also used : HeaderCell(org.eclipse.scout.rt.client.ui.basic.table.HeaderCell) JsonEvent(org.eclipse.scout.rt.ui.html.json.JsonEvent) TableWith3Cols(org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWith3Cols) Test(org.junit.Test)

Aggregations

HeaderCell (org.eclipse.scout.rt.client.ui.basic.table.HeaderCell)2 IHeaderCell (org.eclipse.scout.rt.client.ui.basic.table.IHeaderCell)1 ProcessingException (org.eclipse.scout.rt.platform.exception.ProcessingException)1 JsonEvent (org.eclipse.scout.rt.ui.html.json.JsonEvent)1 TableWith3Cols (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWith3Cols)1 Test (org.junit.Test)1