本文整理汇总了Java中java.beans.Visibility.okToUseGui方法的典型用法代码示例。如果您正苦于以下问题:Java Visibility.okToUseGui方法的具体用法?Java Visibility.okToUseGui怎么用?Java Visibility.okToUseGui使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.Visibility
的用法示例。
在下文中一共展示了Visibility.okToUseGui方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: okToUseGui
import java.beans.Visibility; //导入方法依赖的package包/类
/**
* Notify this instance that it may now render a GUI
*/
public synchronized void okToUseGui() {
if (!okToUseGui) {
okToUseGui = true;
// lets also tell the Children that can that they may use their GUI's
synchronized(children) {
for (Iterator i = children.keySet().iterator(); i.hasNext();) {
Visibility v = getChildVisibility(i.next());
if (v != null) v.okToUseGui();
}
}
}
}
示例2: okToUseGui
import java.beans.Visibility; //导入方法依赖的package包/类
/**
* Notify this instance that it may now render a GUI
*/
public synchronized void okToUseGui() {
if (!okToUseGui) {
okToUseGui = true;
// lets also tell the Children that can that they may use their GUI's
synchronized(children) {
for (Iterator<Object> i = children.keySet().iterator(); i.hasNext();) {
Visibility v = getChildVisibility(i.next());
if (v != null) v.okToUseGui();
}
}
}
}
示例3: okToUseGui
import java.beans.Visibility; //导入方法依赖的package包/类
/**
* Notify this instance that it may now render a GUI
*/
public synchronized void okToUseGui() {
if (!okToUseGui) {
okToUseGui = true;
// lets also tell the Children that can that they may use their GUI's
synchronized(children) {
for (Iterator i = children.keySet().iterator(); i.hasNext();) {
Visibility v = getChildVisibility(i.next());
if (v != null) v.okToUseGui();
}
}
}
}
示例4: okToUseGui
import java.beans.Visibility; //导入方法依赖的package包/类
public synchronized void okToUseGui() {
// Notify this BeanContext and its children that it's OK now to use GUI
this.okToUseGui = true;
for (Iterator it = iterator(); it.hasNext();) {
Object next = it.next();
Visibility vis = getChildVisibility(next);
if (vis != null) {
vis.okToUseGui();
}
}
}
示例5: add
import java.beans.Visibility; //导入方法依赖的package包/类
public boolean add(Object targetChild) {
// We must synchronize on BeanContext.globalHierarchyLock
synchronized (BeanContext.globalHierarchyLock) {
// Validate some values and states to check if we can proceed
if (!addChecks(targetChild)) {
return false;
}
try {
// If child is an instance of BeanContextChild or
// BeanContextProxy,
// invoke setBeanContext() method on this child
// and register BeanContext with its child
// on PropertyChangeListener and VetoableChangeListener.
BeanContextChild ch = getChildBeanContextChild(targetChild);
if (ch != null) {
ch.setBeanContext(getBeanContextPeer());
ch.addPropertyChangeListener(BEAN_CONTEXT, this.pcl);
ch.addVetoableChangeListener(BEAN_CONTEXT, this.vcl);
}
} catch (PropertyVetoException e) {
// Throw IllegalStateException, if PropertyVetoException occurs
throw new IllegalStateException(Messages.getString(
"beans.30", targetChild, e.getMessage())); //$NON-NLS-1$
}
// If child implements Visibility,
// set an appropriate type of ability to render GUI
Visibility vis = getChildVisibility(targetChild);
if (vis != null) {
if (this.okToUseGui) {
vis.okToUseGui();
} else {
vis.dontUseGui();
}
}
// Check if this child implements Serializable and increase
// the number of serializable children of the BeanContext
if (getChildSerializable(targetChild) != null) {
this.serializable++;
}
// Finally add child to the collection
addChild(targetChild);
}
return true;
}