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());
}
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();
}
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);
}
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();
}
}
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);
}
Aggregations