Search in sources :

Example 1 with FormMenu

use of org.eclipse.scout.rt.ui.html.json.form.fixtures.FormMenu in project scout.rt by eclipse.

the class JsonFormMenuTest method testPreventFormDisposal.

/**
 * Form disposal is controlled by the model and must not be triggered by the parent
 */
@Test
public void testPreventFormDisposal() {
    FormMenu button = new FormMenu();
    FormWithOneField form = new FormWithOneField();
    form.start();
    button.setForm(form);
    JsonFormMenu<IFormMenu<IForm>> jsonFormMenu = m_uiSession.createJsonAdapter(button, null);
    assertNotNull(jsonFormMenu.getAdapter(form));
    jsonFormMenu.dispose();
    // Form has not been closed yet -> must still be registered
    assertNotNull(jsonFormMenu.getAdapter(form));
    form.doClose();
    assertNull(jsonFormMenu.getAdapter(form));
}
Also used : IFormMenu(org.eclipse.scout.rt.client.ui.form.IFormMenu) FormMenu(org.eclipse.scout.rt.ui.html.json.form.fixtures.FormMenu) JsonFormMenu(org.eclipse.scout.rt.ui.html.json.desktop.JsonFormMenu) IFormMenu(org.eclipse.scout.rt.client.ui.form.IFormMenu) FormWithOneField(org.eclipse.scout.rt.ui.html.json.form.fixtures.FormWithOneField) Test(org.junit.Test)

Aggregations

IFormMenu (org.eclipse.scout.rt.client.ui.form.IFormMenu)1 JsonFormMenu (org.eclipse.scout.rt.ui.html.json.desktop.JsonFormMenu)1 FormMenu (org.eclipse.scout.rt.ui.html.json.form.fixtures.FormMenu)1 FormWithOneField (org.eclipse.scout.rt.ui.html.json.form.fixtures.FormWithOneField)1 Test (org.junit.Test)1