return super.waitFinished(timeout); } else { return true; return super.waitFinished(timeout);
em.log(Level.FINE, " ## waiting for it to be finished: {0} now: {1}", new Object[]{lastThread, Thread.currentThread()}); // NOI18N super.waitFinished(); super.waitFinished();
@Override public Boolean get() throws InterruptedException, ExecutionException { WAIT.waitFinished(); return result; }
@Override public void run() { CppEditorSupport.super.prepareDocument().waitFinished(); setupSlowDocumentProperties(CppEditorSupport.super.getDocument()); } });
/** For testing purposes. */ final void waitFinished () { setContentsTask.waitFinished (); getContentsTask.waitFinished (); }
private void waitFinished() { if (parael != null) { parael.waitFinished(); } }
/** Blocks if the processing of content of folder is in progress. */ public void waitProcessingFinished () { Task t = comparatorTask; if (t != null) { t.waitFinished (); } t = refreshTask; if (t != null) { t.waitFinished (); } }
@Override public Boolean get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (!WAIT.waitFinished(unit.toMillis(timeout))) { throw new TimeoutException(); } return result; }
public void waitFinished () { if (javax.swing.SwingUtilities.isEventDispatchThread ()) { run (); } else { super.waitFinished (); } } }
/** Reload the document in response to external modification. * @see #reloadDocumentTask */ protected void reloadDocument() { reloadDocumentTask ().waitFinished (); }
public boolean canUndo () { /* First it must be checked that there are * undoable edits waiting to be added to undoredo. */ boolean empty; synchronized (runus) { empty = runus.isEmpty (); } if (!empty) { task.waitFinished (); } return super.canUndo (); }
public boolean canUndo () { /* First it must be checked that there are * undoable edits waiting to be added to undoredo. */ boolean empty; synchronized (runus) { empty = runus.isEmpty (); } if (!empty) { task.waitFinished (); } return super.canUndo (); }
public static StyledDocument openDocument(CloneableEditorSupport ces) { if (ces == null) { return null; } StyledDocument document = null; try { try { document = ces.openDocument(); } catch (UserQuestionException e) { e.confirmed(); document = ces.openDocument(); } } catch (IOException ex) { Exceptions.printStackTrace(ex); } ces.prepareDocument().waitFinished(); return document; }
public Node[] getNodes(boolean optimalResult) { if (optimalResult) { if (checkChildrenMutex()) { active = true; FolderList.find(folder.getPrimaryFile(), true).waitProcessingFinished(); Task task = refreshChildren(); task.waitFinished(); } else { ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, new IllegalStateException("getNodes(true) called while holding the Children.MUTEX") // NOI18N ); } } Node[] res = getNodes(); refreshRunnable.clear(); // we can clean the references to data objects now // they are no longer needed return res; }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = pos.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; pos.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = position.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; position.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = pos.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; pos.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
/** Remove annotation to this Annotatable class * @param anno annotation which will be detached from this class */ protected void removeAnnotation(Annotation anno) { super.removeAnnotation(anno); StyledDocument doc = position.getCloneableEditorSupport ().getDocument (); // document is not opened and so no annotation is attached to it if (doc == null) return; position.getCloneableEditorSupport().prepareDocument().waitFinished(); if (anno.isInDocument()) { anno.setInDocument(false); NbDocument.removeAnnotation(doc, anno); } }
/** Add annotation to this Annotatable class * @param anno annotation which will be attached to this class */ protected void addAnnotation(Annotation anno) { super.addAnnotation(anno); StyledDocument doc = position.getCloneableEditorSupport ().getDocument (); // document is not opened and so the annotation will be added to document later if (doc == null) return; position.getCloneableEditorSupport().prepareDocument().waitFinished(); try { if (!anno.isInDocument()) { anno.setInDocument(true); NbDocument.addAnnotation(doc, position.getPosition(), length, anno); } } catch (IOException ex) { ErrorManager.getDefault ().notify ( ErrorManager.EXCEPTION, ex); } }
/** Add annotation to this Annotatable class * @param anno annotation which will be attached to this class */ protected void addAnnotation(Annotation anno) { super.addAnnotation(anno); StyledDocument doc = pos.getCloneableEditorSupport ().getDocument (); // document is not opened and so the annotation will be added to document later if (doc == null) return; pos.getCloneableEditorSupport().prepareDocument().waitFinished(); try { if (!anno.isInDocument()) { anno.setInDocument(true); // #33165 - find position that is surely at begining of line FindAnnotationPosition fap = new FindAnnotationPosition(doc, pos.getPosition()); doc.render(fap); NbDocument.addAnnotation (doc, fap.getAnnotationPosition(), -1, anno); } } catch (IOException ex) { ErrorManager.getDefault ().notify ( ErrorManager.EXCEPTION, ex); } }