BeanContextSupport.java 文件源码

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

项目:fiscevm 作者:
/**
 * Returns true if this context or its children needs GUI to work properly.
 * <p>
 * The implementation checks the peer and all the children that implement
 * <code>Visibility</code> to see if any of their <code>needsGui()</code> 
 * returns true, and if any of the children extends 
 * <code>java.awt.Component</code>.</p>
 * 
 * @see java.beans.Visibility#needsGui()
 */
public boolean needsGui() {
    if (inNeedsGui) {
        return false;
    }
    inNeedsGui = true;

    try {
        if (getBeanContextPeer() != this) {
            if (getBeanContextPeer().needsGui()) {
                return true;
            }
        }
        Object childs[] = copyChildren();
        for (int i = 0; i < childs.length; i++) {
            Visibility v = getChildVisibility(childs[i]);
            if (v != null && v.needsGui()) {
                return true;
            }
        }
        return false;
    } finally {
        inNeedsGui = false;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号