@Test public void testIsBusy() throws Exception { System.setProperty(SystemUtilities.HEADLESS_PROPERTY, Boolean.FALSE.toString()); final CountDownLatch startGate = new CountDownLatch(1); final CountDownLatch endGate = new CountDownLatch(1); final AtomicBoolean exception = new AtomicBoolean(); runSwing(new Runnable() { @Override public void run() { startGate.countDown(); try { endGate.await(10, TimeUnit.SECONDS); } catch (InterruptedException e) { exception.set(true); } } }, false); startGate.await(10, TimeUnit.SECONDS); manager.update(); assertTrue("Manager not busy after requesting an update", manager.isBusy()); endGate.countDown(); waitForManager(); assertTrue("Manager still busy after waiting for update", !manager.isBusy()); assertFalse("Interrupted waiting for CountDowLatch", exception.get()); }
public synchronized boolean isBusy() { if (disposed) { return false; } return requestTime != NONE || workCount.get() != 0; }
SwingUpdateManager { public synchronized boolean isBusy() { if (disposed) { return false; } return requestTime != NONE || workCount.get() != 0; } }
SwingUpdateManager { public synchronized boolean isBusy() { if (disposed) { return false; } return requestTime != NONE || workCount.get() != 0; } SwingUpdateManager(Runnable r);  SwingUpdateManager(int minDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, String name, Runnable r); }
SwingUpdateManager { public synchronized boolean isBusy() { if (disposed) { return false; } return requestTime != NONE || workCount.get() != 0; } SwingUpdateManager(Runnable r);  SwingUpdateManager(int minDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, String name, Runnable r); synchronized void update(); synchronized void updateLater(); void updateNow(); synchronized void stop(); synchronized boolean hasPendingUpdates(); synchronized boolean isBusy(); synchronized void dispose(); synchronized boolean isDisposed(); @Override String toString(); String toStringDebug(); }
SwingUpdateManager { public synchronized boolean isBusy() { if (disposed) { return false; } return requestTime != NONE || workCount.get() != 0; } SwingUpdateManager(Runnable r);  SwingUpdateManager(int minDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, Runnable r);  SwingUpdateManager(int minDelay, int maxDelay, String name, Runnable r); synchronized void update(); synchronized void updateLater(); void updateNow(); synchronized void stop(); synchronized boolean hasPendingUpdates(); synchronized boolean isBusy(); synchronized void dispose(); synchronized boolean isDisposed(); @Override String toString(); String toStringDebug(); static final int DEFAULT_MAX_DELAY; }