Search in sources :

Example 1 with DisplayableMenu

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

Aggregations

ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)1 TableWithNonDisplayableMenu (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithNonDisplayableMenu)1 DisplayableMenu (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithNonDisplayableMenu.DisplayableMenu)1 NonDisplayableMenu (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithNonDisplayableMenu.NonDisplayableMenu)1 Test (org.junit.Test)1