@Override public Void get() throws InterruptedException, ExecutionException { if (cancelled.get()) { throw new CancellationException(); } t.waitFinished(); if (cancelled.get()) { throw new CancellationException(); } return null; }
@Override public Void get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (cancelled.get()) { throw new CancellationException(); } long millis = TimeUnit.MILLISECONDS.convert(timeout, unit); t.waitFinished(millis); if (cancelled.get()) { throw new CancellationException(); } return null; } }
RequestProcessor.Task task = RP.post(new Run()); return task.waitFinished(milliseconds);
@Override public Void get() throws InterruptedException, ExecutionException { scanning.waitFinished(); if (excPtr[0] != null) { throw new ExecutionException(excPtr[0]); } return null; }
@Override public void runOffEventDispatchThread(Runnable operation, String operationDescr, AtomicBoolean cancelOperation, boolean waitForCanceled, int waitCursorAfter, int dialogAfter) { if (SwingUtilities.isEventDispatchThread()) { Task t = WORKER.post(operation); t.waitFinished(); } else { operation.run(); } } }
void waitFor() { inp.stopInput(); // if (inTask != null) { // inTask.waitFinished(); // } if (outTask != null) { outTask.waitFinished(); } }
@Override public Node[] getNodes( boolean optimal ) { if ( optimal ) { Node[] garbage = super.getNodes( false ); task.waitFinished(); } return super.getNodes( false ); }
/** Updates actions states now if there is pending event. */ public void update() { if (EventQueue.isDispatchThread()) { try { timer.waitFinished(100); } catch (InterruptedException ex) { LOG.log(Level.FINE, null, ex); } } else { timer.waitFinished(); } }
@Override public void runOffEventDispatchThread(Runnable operation, String operationDescr, AtomicBoolean cancelOperation, boolean waitForCanceled, int waitCursorAfter, int dialogAfter) { if (SwingUtilities.isEventDispatchThread()) { Task t = WORKER.post(operation); t.waitFinished(); } else { operation.run(); } } }
/** Waits till all async processing is finished */ final void waitFinished () { if (selectionSyncTask != null) { selectionSyncTask.waitFinished (); } }
@Override public Void get() throws InterruptedException, ExecutionException { if (cancelled.get()) { throw new CancellationException(); } t.waitFinished(); if (cancelled.get()) { throw new CancellationException(); } return null; }
private void waitDictionaryConstructed() { Task t = workingTask.get(); if (t != null) { t.waitFinished(); workingTask.set(null); } }
public void run() { for (Task task : tasks) { task.waitFinished(); } NodeRefreshTask.this.refresh(node); } });
public JPopupMenu getPopupMenu() { RequestProcessor.Task t = task; if (t!=null && !t.isFinished()){ t.waitFinished(); } return super.getPopupMenu(); }
public void storeSettings(final WizardDescriptor descriptor) { // WARNING - called twice - probably bug in Dialog API if (searchRunnable != null) { searchRunnable.stop(); searchTask.waitFinished(); searchRunnable = null; searchTask = null; } descriptor.putProperty(PROP_PLATFORM_FOLDERS, selectedFolders); }
/*package-local*/ synchronized void waitInitTask() { if (initTask == null) { return; } initTask.waitFinished(); initTask = null; }
/** Waits till all async processing is finished */ final void waitFinished() { if (selectionSyncTask != null) { selectionSyncTask.waitFinished(); } }
@Override public Node[] getNodes(boolean optimalResult) { Node[] result = super.getNodes(); if (optimalResult) { // The getNodes() call above called addNotify() and started the task // for the first time if needed. task.waitFinished(); result = super.getNodes(); } return result; }
LOG.fine("refreshAll - scheduled"); //NOI18N taskToWaitFor.waitFinished(); LOG.fine("refreshAll - finished"); //NOI18N
@Override final void waitRefreshed() { Task w = watcherTask; if (w != null) { w.waitFinished(); } }