Search in sources :

Example 1 with TableWithoutMenus

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

Example 2 with TableWithoutMenus

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

Example 3 with TableWithoutMenus

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

Aggregations

ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)3 TableWithoutMenus (org.eclipse.scout.rt.ui.html.json.table.fixtures.TableWithoutMenus)3 Test (org.junit.Test)3 FormTableControl (org.eclipse.scout.rt.ui.html.json.table.fixtures.FormTableControl)2 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)1 JsonMenu (org.eclipse.scout.rt.ui.html.json.menu.JsonMenu)1 Menu (org.eclipse.scout.rt.ui.html.json.menu.fixtures.Menu)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