org.openide.util.Task.waitFinished()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(71)

本文整理了Java中org.openide.util.Task.waitFinished()方法的一些代码示例,展示了Task.waitFinished()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Task.waitFinished()方法的具体详情如下:
包路径:org.openide.util.Task
类名称:Task
方法名:waitFinished

Task.waitFinished介绍

[英]Wait until the task is finished. Changed not to be final in version 1.5
[中]等到任务完成。在1.5版中更改为不为final

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

return super.waitFinished(timeout);
  } else {
    return true;
return super.waitFinished(timeout);

代码示例来源:origin: org.netbeans.api/org-openide-util

em.log(Level.FINE, "    ## waiting for it to be finished: {0} now: {1}", new Object[]{lastThread, Thread.currentThread()}); // NOI18N
    super.waitFinished();
super.waitFinished();

代码示例来源:origin: org.netbeans.modules/org-netbeans-bootstrap

@Override
public Boolean get() throws InterruptedException, ExecutionException {
  WAIT.waitFinished();
  return result;
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-source

@Override
  public void run() {
    CppEditorSupport.super.prepareDocument().waitFinished();
    setupSlowDocumentProperties(CppEditorSupport.super.getDocument());
  }
});

代码示例来源:origin: org.netbeans.modules/org-netbeans-bootstrap

/** For testing purposes.
 */
final void waitFinished () {
  setContentsTask.waitFinished ();
  getContentsTask.waitFinished ();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-bootstrap

private void waitFinished() {
  if (parael != null) {
    parael.waitFinished();
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

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

代码示例来源:origin: org.netbeans.modules/org-netbeans-bootstrap

@Override
public Boolean get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  if (!WAIT.waitFinished(unit.toMillis(timeout))) {
    throw new TimeoutException();
  }
  return result;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

public void waitFinished () {
    if (javax.swing.SwingUtilities.isEventDispatchThread ()) {
      run ();
    } else {
      super.waitFinished ();
    }
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

/** Reload the document in response to external modification.
* @see #reloadDocumentTask
*/
protected void reloadDocument() {
  reloadDocumentTask ().waitFinished ();
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

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

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

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

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelutil

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;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders

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;
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** 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);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

/** 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);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** 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);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** 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);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** 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);
  }
}

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

/** 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);
  }
}

相关文章