Search in sources :

Example 1 with AbstractPageWithTable

use of org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable in project scout.rt by eclipse.

the class ColumnAutoResizeTest method testReloadPage_multipleSummaryColumns.

@Test
public void testReloadPage_multipleSummaryColumns() throws Exception {
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    desktop.setAvailableOutlines(Collections.singletonList(new PageWithTableOutline()));
    desktop.setOutline(PageWithTableOutline.class);
    desktop.activateFirstPage();
    IOutline outline = desktop.getOutline();
    IPage<?> page = outline.getActivePage();
    assertNotNull(page);
    assertTrue(page instanceof AbstractPageWithTable);
    ITable table = ((AbstractPageWithTable) page).getTable();
    assertTrue(table instanceof ColumnAutoResizeTest.PageWithTable.TestTable);
    ColumnAutoResizeTest.PageWithTable.TestTable testTable = (ColumnAutoResizeTest.PageWithTable.TestTable) table;
    IColumn col1 = CollectionUtility.firstElement(testTable.getColumns());
    int width1 = col1.getWidth();
    // when page is reloaded, the column width shall not be different afterwards
    page.reloadPage();
    int width2 = col1.getWidth();
    assertTrue(width1 == width2);
}
Also used : AbstractPageWithTable(org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable) IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) AbstractPageWithTable(org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Test(org.junit.Test)

Aggregations

ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 IDesktop (org.eclipse.scout.rt.client.ui.desktop.IDesktop)1 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)1 AbstractPageWithTable (org.eclipse.scout.rt.client.ui.desktop.outline.pages.AbstractPageWithTable)1 Test (org.junit.Test)1