AsynchChildren.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
/**
 * Notify this AsynchChildren that it should reconstruct its children,
 * calling <code>provider.asynchCreateKeys()</code> and setting the
 * keys to that.  Call this method if the list of child objects is known
 * or likely to have changed.
 * @param immediate If true, the keys are updated synchronously from the
 *  calling thread.  Set this to true only if you know that updating
 *  the keys will <i>not</i> be an expensive or time-consuming operation.
 */ 
public void refresh(boolean immediate) {
    immediate &= !EventQueue.isDispatchThread();
    logger.log (Level.FINE, "Refresh on {0} immediate {1}", new Object[]  //NOI18N
        { this, immediate });
    if (logger.isLoggable(Level.FINEST)) {
        logger.log (Level.FINEST, "Refresh: ", new Exception()); //NOI18N
    }
    if (immediate) {
        boolean done;
        List <T> keys = new LinkedList <T> ();
        do {
            done = factory.createKeys(keys);
        } while (!done);
        setKeys (keys);
    } else {
        task.schedule (0);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号