Search in sources :

Example 6 with ITableField

use of org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField in project scout.rt by eclipse.

the class JsonTableFieldTest method testPreventTableDisposal.

@Test
public void testPreventTableDisposal() {
    // Create tablePage
    IPageWithTable<?> tablePage = createTablePageAndSelectNode();
    ITable tablePageTable = tablePage.getTable();
    JsonOutline<IOutline> jsonOutline = UiSessionTestUtility.newJsonAdapter(m_uiSession, tablePage.getOutline(), null);
    Assert.assertNotNull(jsonOutline.getAdapter(tablePageTable));
    // Create table field which uses the table from the table page
    ITableField<ITable> tableField = new TableField<ITable>();
    JsonTableField<ITableField<?>> jsonTableField = UiSessionTestUtility.newJsonAdapter(m_uiSession, tableField, null);
    tableField.setTable(tablePageTable, true);
    // Dispose table field -> table must not be disposed because table page still needs it
    jsonTableField.dispose();
    assertNotNull(jsonOutline.getAdapter(tablePageTable));
    assertTrue(jsonOutline.getAdapter(tablePageTable).isInitialized());
}
Also used : ITableField(org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField) IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) ITable(org.eclipse.scout.rt.client.ui.basic.table.ITable) ITableField(org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField) TableField(org.eclipse.scout.rt.ui.html.json.form.fields.tablefield.fixtures.TableField) Test(org.junit.Test)

Aggregations

ITableField (org.eclipse.scout.rt.client.ui.form.fields.tablefield.ITableField)6 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)5 TableField (org.eclipse.scout.rt.ui.html.json.form.fields.tablefield.fixtures.TableField)4 Test (org.junit.Test)4 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)3 IPageWithTable (org.eclipse.scout.rt.client.ui.desktop.outline.pages.IPageWithTable)3 IForm (org.eclipse.scout.rt.client.ui.form.IForm)2 Table (org.eclipse.scout.rt.ui.html.json.table.fixtures.Table)2 IClientSession (org.eclipse.scout.rt.client.IClientSession)1 IKeyStroke (org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke)1 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)1 IViewButton (org.eclipse.scout.rt.client.ui.action.view.IViewButton)1 CalendarComponent (org.eclipse.scout.rt.client.ui.basic.calendar.CalendarComponent)1 ICalendar (org.eclipse.scout.rt.client.ui.basic.calendar.ICalendar)1 IFileChooser (org.eclipse.scout.rt.client.ui.basic.filechooser.IFileChooser)1 IPlanner (org.eclipse.scout.rt.client.ui.basic.planner.IPlanner)1 IAggregateTableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.IAggregateTableControl)1 IFormTableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.IFormTableControl)1 ITableControl (org.eclipse.scout.rt.client.ui.basic.table.controls.ITableControl)1 ITree (org.eclipse.scout.rt.client.ui.basic.tree.ITree)1