Search in sources :

Example 36 with IDesktop

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

the class OutlineDeepLinkHandlerTest method testHandleImpl.

/**
 * Checks if the OutlineHandler activates the correct outline for a given deep-link path.
 */
@Test
public void testHandleImpl() throws Exception {
    IDesktop desktop = ClientSessionProvider.currentSession().getDesktop();
    IOutline outlineFoo = new P_OutlineFoo();
    IOutline outlineBar = new P_OutlineBar();
    addOutlineToDesktop(desktop, outlineFoo);
    addOutlineToDesktop(desktop, outlineBar);
    desktop.activateOutline(outlineBar);
    assertSame(outlineBar, desktop.getOutline());
    OutlineDeepLinkHandler handler = new OutlineDeepLinkHandler();
    handler.handle("outline-04446");
    assertSame(outlineFoo, desktop.getOutline());
}
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 37 with IDesktop

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

the class FileChooser method startChooser.

@Override
public List<BinaryResource> startChooser() {
    m_files = null;
    m_blockingCondition.setBlocking(true);
    IDesktop desktop = ClientSessionProvider.currentSession().getDesktop();
    desktop.showFileChooser(this);
    try {
        waitFor();
    } finally {
        desktop.hideFileChooser(this);
        fireClosed();
    }
    return getFiles();
}
Also used : IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop)

Example 38 with IDesktop

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

the class MessageBoxTest method setUp.

@Before
public void setUp() {
    IDesktop desktop = ClientSessionProvider.currentSession().getDesktop();
    m_desktopSpy = Mockito.spy(desktop);
    TestEnvironmentClientSession.get().replaceDesktop(m_desktopSpy);
}
Also used : IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) Before(org.junit.Before)

Example 39 with IDesktop

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

the class MediumMemoryPolicy method beforeTablePageLoadData.

/**
 * when table contains 1000+ rows clear table before loading new data, thus disabling "replaceRow" mechanism
 */
@Override
public void beforeTablePageLoadData(IPageWithTable<?> page) {
    if (m_release) {
        // make sure inactive outlines have no selection that "keeps" the pages
        IDesktop desktop = ClientSessionProvider.currentSession().getDesktop();
        for (IOutline o : desktop.getAvailableOutlines()) {
            if (o != desktop.getOutline()) {
                o.selectNode(null);
            }
        }
        desktop.releaseUnusedPages();
        m_release = false;
    }
    if (page.getTable() != null && page.getTable().getRowCount() > 1000) {
        page.getTable().discardAllRows();
    }
}
Also used : IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop)

Example 40 with IDesktop

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

the class AbstractWizard method waitFor.

@Override
public void waitFor() {
    // check if the desktop is observing this process
    IDesktop desktop = getDesktop();
    if (desktop == null || !desktop.isOpened()) {
        throw new ProcessingException("Cannot wait for {}. No desktop found, or the desktop is not opened in the UI yet.", new Object[] { getClass().getName() }).withCode(WAIT_FOR_ERROR_CODE);
    }
    m_blockingCondition.waitFor(ModelJobs.EXECUTION_HINT_UI_INTERACTION_REQUIRED);
}
Also used : IExtensibleObject(org.eclipse.scout.rt.shared.extension.IExtensibleObject) IDesktop(org.eclipse.scout.rt.client.ui.desktop.IDesktop) ProcessingException(org.eclipse.scout.rt.platform.exception.ProcessingException)

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