use of org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithoutMenus in project scout.rt by eclipse.
the class JsonTableTest method testMenuDisposalOnPropertyChange.
@Test
public void testMenuDisposalOnPropertyChange() throws JSONException {
ITable table = new TableWithoutMenus();
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
jsonTable.toJson();
// ----------
Menu menu1 = new Menu();
table.getContextMenu().addChildAction(menu1);
assertNotNull(jsonTable.getAdapter(menu1));
assertTrue(jsonTable.getAdapter(menu1).isInitialized());
table.getContextMenu().removeChildAction(menu1);
assertNull(jsonTable.getAdapter(menu1));
}
use of org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithoutMenus in project scout.rt by eclipse.
the class JsonTableTest method testMultipleTableControlDisposallOnPropertyChange.
@Test
public void testMultipleTableControlDisposallOnPropertyChange() throws JSONException {
ITable table = new TableWithoutMenus();
table.initTable();
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
jsonTable.toJson();
// ----------
FormTableControl tableControl1 = new FormTableControl();
FormTableControl tableControl2 = new FormTableControl();
table.addTableControl(tableControl1);
table.addTableControl(tableControl2);
assertNotNull(jsonTable.getAdapter(tableControl1));
assertTrue(jsonTable.getAdapter(tableControl1).isInitialized());
assertNotNull(jsonTable.getAdapter(tableControl2));
assertTrue(jsonTable.getAdapter(tableControl2).isInitialized());
table.removeTableControl(tableControl1);
assertNull(jsonTable.getAdapter(tableControl1));
assertNotNull(jsonTable.getAdapter(tableControl2));
assertTrue(jsonTable.getAdapter(tableControl2).isInitialized());
}
use of org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithoutMenus in project scout.rt by eclipse.
the class JsonTableTest method testTableControlDisposalOnPropertyChange.
@Test
public void testTableControlDisposalOnPropertyChange() throws JSONException {
ITable table = new TableWithoutMenus();
table.initTable();
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
jsonTable.toJson();
// ----------
FormTableControl control = new FormTableControl();
table.addTableControl(control);
assertNotNull(jsonTable.getAdapter(control));
assertTrue(jsonTable.getAdapter(control).isInitialized());
table.removeTableControl(control);
assertNull(jsonTable.getAdapter(control));
}
Aggregations