use of org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithNonDisplayableMenu.DisplayableMenu in project scout.rt by eclipse.
the class JsonTableTest method testMenuDisposalOnPropertyChangeWithNonDisplayableMenu.
/**
* Tests whether it is possible to dispose (or replace) menus if at least one menu is not displayable.<br>
*/
@Test
public void testMenuDisposalOnPropertyChangeWithNonDisplayableMenu() throws JSONException {
ITable table = new TableWithNonDisplayableMenu();
table.initTable();
JsonTable<ITable> jsonTable = UiSessionTestUtility.newJsonAdapter(m_uiSession, table, null);
jsonTable.toJson();
// ----------
DisplayableMenu displayableMenu = table.getMenuByClass(TableWithNonDisplayableMenu.DisplayableMenu.class);
NonDisplayableMenu NonDisplayableMenu = table.getMenuByClass(TableWithNonDisplayableMenu.NonDisplayableMenu.class);
assertNull(jsonTable.getAdapter(NonDisplayableMenu));
assertNotNull(jsonTable.getAdapter(displayableMenu));
assertTrue(jsonTable.getAdapter(displayableMenu).isInitialized());
table.getContextMenu().removeChildAction(NonDisplayableMenu);
table.getContextMenu().removeChildAction(displayableMenu);
assertNull(jsonTable.getAdapter(NonDisplayableMenu));
assertNull(jsonTable.getAdapter(displayableMenu));
}
Aggregations