Search in sources :

Example 21 with IDesktop

use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.

the class PageWithTable7Test method testExecPageDataLoaded.

@Test
public void testExecPageDataLoaded() {
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    desktop.setAvailableOutlines(Collections.singletonList(new PageWithTableOutline()));
    desktop.setOutline(PageWithTableOutline.class);
    desktop.activateFirstPage();
    IOutline outline = desktop.getOutline();
    PageWithTable page = (PageWithTable) outline.getActivePage();
    page.m_counter = 1;
    page.reloadPage();
    page.m_counter = 2;
    page.reloadPage();
    page.m_counter = 3;
    page.reloadPage();
    ScoutAssert.assertListEquals(new String[] { "counter: 0 value: first", "counter: 1 value: second", "counter: 2 value: third", "counter: 3 value: fourth" }, page.m_protocol);
}
Also used : IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Test(org.junit.Test)

Example 22 with IDesktop

use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.

the class PageWithTableAndPageBeanTest method prepareTest.

private PageWithTable prepareTest() {
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    assertNotNull(desktop);
    desktop.setAvailableOutlines(Collections.singletonList(new PageWithTableOutline()));
    desktop.setOutline(PageWithTableOutline.class);
    desktop.activateFirstPage();
    IOutline outline = desktop.getOutline();
    assertNotNull(outline);
    assertSame(PageWithTableOutline.class, outline.getClass());
    IPage<?> page = outline.getActivePage();
    assertNotNull(page);
    assertSame(PageWithTable.class, page.getClass());
    return (PageWithTable) page;
}
Also used : IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop)

Example 23 with IDesktop

use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.

the class PageWithTableAndTableCustomizerWhenEditingThenMissingSelectionTest method setUp.

@Before
public void setUp() {
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    Outline outline = new Outline();
    desktop.setAvailableOutlines(Collections.singletonList(outline));
    desktop.activateOutline(outline);
}
Also used : AbstractOutline(org.eclipse.scout.rt.client.ui.desktop.outline.AbstractOutline) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Before(org.junit.Before)

Example 24 with IDesktop

use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.

the class PageWithTableAndTableCustomizerWhenEditingThenMissingSelectionTest method testWithUnchangedTableCustomizer.

@Test
public void testWithUnchangedTableCustomizer() throws Exception {
    tableCustomizerSerialDataIsRandom = false;
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    desktop.activateFirstPage();
    PageWithTable page = (PageWithTable) desktop.getOutline().getActivePage();
    PageWithTable.Table table = page.getTable();
    // 
    table.selectRow(0);
    assertSelection(table, CollectionUtility.arrayList(1));
    // 
    table.selectRow(1);
    assertSelection(table, CollectionUtility.arrayList(2));
    // 
    table.getMenuByClass(PageWithTable.Table.EditAccountMenu.class).doAction();
    assertSelection(table, CollectionUtility.arrayList(2));
}
Also used : IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Test(org.junit.Test)

Example 25 with IDesktop

use of org.eclipse.scout.rt.client.ui.desktop.IDesktop in project scout.rt by eclipse.

the class PageWithTableAndTableCustomizerWhenEditingThenMissingSelectionTest method testWithChangedTableCustomizer.

@Test
public void testWithChangedTableCustomizer() throws Exception {
    tableCustomizerSerialDataIsRandom = true;
    IDesktop desktop = TestEnvironmentClientSession.get().getDesktop();
    desktop.activateFirstPage();
    PageWithTable page = (PageWithTable) desktop.getOutline().getActivePage();
    PageWithTable.Table table = page.getTable();
    // 
    table.selectRow(0);
    assertSelection(table, CollectionUtility.arrayList(1));
    // 
    table.selectRow(1);
    assertSelection(table, CollectionUtility.arrayList(2));
    // 
    table.getMenuByClass(PageWithTable.Table.EditAccountMenu.class).doAction();
    assertSelection(table, CollectionUtility.arrayList(2));
}
Also used : IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Test(org.junit.Test)

Aggregations

IDesktop (org.eclipse.scout.rt.client.ui.desktop.IDesktop)61 Test (org.junit.Test)36 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)18 IRunnable (org.eclipse.scout.rt.platform.util.concurrent.IRunnable)7 JsonAdapterRegistryTest (org.eclipse.scout.rt.ui.html.json.JsonAdapterRegistryTest)7 IOutlineViewButton (org.eclipse.scout.rt.client.ui.desktop.outline.IOutlineViewButton)5 JsonEvent (org.eclipse.scout.rt.ui.html.json.JsonEvent)5 JsonForm (org.eclipse.scout.rt.ui.html.json.form.JsonForm)5 JSONObject (org.json.JSONObject)5 ITreeNode (org.eclipse.scout.rt.client.ui.basic.tree.ITreeNode)4 IClientSession (org.eclipse.scout.rt.client.IClientSession)3 ITree (org.eclipse.scout.rt.client.ui.basic.tree.ITree)3 IForm (org.eclipse.scout.rt.client.ui.form.IForm)3 DesktopWithOneOutline (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.DesktopWithOneOutline)3 OutlineViewButton (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.OutlineViewButton)3 OutlineWithOneNode (org.eclipse.scout.rt.ui.html.json.desktop.fixtures.OutlineWithOneNode)3 FormWithOneField (org.eclipse.scout.rt.ui.html.json.form.fixtures.FormWithOneField)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)2 PropertyChangeListener (java.beans.PropertyChangeListener)2 Locale (java.util.Locale)2