/** * {@inheritDoc} */ @Override public void doInvokeLaters() { backing.doInvokeLaters(); }
/** * The framework calls this method at the end of the serviceRequest method. The default implementation is that only * a root wcomponent actually runs them. */ protected void invokeLaters() { if (getParent() == null) { UIContext uic = UIContextHolder.getCurrent(); if (uic != null) { uic.doInvokeLaters(); } } }
/** * When the window is targetted, we need to run the "laters". If we don't do this, they will not run because a * targetted request bypasses the root component that would normally have run them. */ @Override protected void invokeLaters() { if (getState() == ACTIVE_STATE && isTargeted()) { UIContextHolder.getCurrent().doInvokeLaters(); } else { super.invokeLaters(); } }
@Test public void testDoInvokeLaters() { TestSumRunner summer1 = new TestSumRunner(COUNT1); // sun 1 to 10 - expect 55 TestSumRunner summer2 = new TestSumRunner(COUNT2); // sum 1 to 5 - expect 15 UIContext uic = createUIContext(); // doInvokeLaters on empty list - nothing happens uic.doInvokeLaters(); // set some runnables and doInvokeLaters uic.invokeLater(summer1); uic.invokeLater(summer2); uic.doInvokeLaters(); Assert.assertEquals("should return expected sum", SUM1, summer1.getSum()); Assert.assertEquals("should return expected sum", SUM2, summer2.getSum()); }
tuic.doInvokeLaters(); } finally { UIContextHolder.popContext();
delegate.doInvokeLaters(); } finally { UIContextHolder.popContext();