当前位置: 首页>>代码示例>>Java>>正文


Java VetoableChangeListener.vetoableChange方法代码示例

本文整理汇总了Java中java.beans.VetoableChangeListener.vetoableChange方法的典型用法代码示例。如果您正苦于以下问题:Java VetoableChangeListener.vetoableChange方法的具体用法?Java VetoableChangeListener.vetoableChange怎么用?Java VetoableChangeListener.vetoableChange使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.beans.VetoableChangeListener的用法示例。


在下文中一共展示了VetoableChangeListener.vetoableChange方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: atomicUnlockImpl

import java.beans.VetoableChangeListener; //导入方法依赖的package包/类
final void atomicUnlockImpl (boolean notifyUnmodifyIfNoMods) {
    boolean noModsAndOuterUnlock = false;
    synchronized (this) {
        if (atomicDepth <= 0) {
            throw new IllegalStateException("atomicUnlock() without atomicLock()"); // NOI18N
        }

        if (--atomicDepth == 0) { // lock really ended
            fireAtomicUnlock(atomicLockEventInstance);

            noModsAndOuterUnlock = !checkAndFireAtomicEdits();
            atomicLockListenerList = null;
            extWriteUnlock();
        }
    }

    if (notifyUnmodifyIfNoMods && noModsAndOuterUnlock) {
        // Notify unmodification if there were no document modifications
        // inside the atomic section.
        // Fire VetoableChangeListener outside Document lock
        VetoableChangeListener l = (VetoableChangeListener) getProperty(MODIFICATION_LISTENER_PROP);
        if (l != null) {
            try {
                // Notify unmodification by Boolean.FALSE
                l.vetoableChange(new PropertyChangeEvent(this, "modified", null, Boolean.FALSE));
            } catch (java.beans.PropertyVetoException ex) {
                // Ignored (should not be thrown)
            }
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:32,代码来源:BaseDocument.java

示例2: notifyModified

import java.beans.VetoableChangeListener; //导入方法依赖的package包/类
private boolean notifyModified (Object o) {
    boolean canBeModified = true;
    if (o instanceof VetoableChangeListener) {
        VetoableChangeListener l = (VetoableChangeListener)o;
        try {
            l.vetoableChange (new java.beans.PropertyChangeEvent (this, "modified", null, Boolean.TRUE));
        } catch (java.beans.PropertyVetoException ex) {
            canBeModified = false;
        }
    }
    return canBeModified;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:NbLikeEditorKit.java

示例3: vetoableChange

import java.beans.VetoableChangeListener; //导入方法依赖的package包/类
/** Tests if the object we reference to still exists and
* if so, delegate to it. Otherwise remove from the source
* if it has removePropertyChangeListener method.
*/
@Override public void vetoableChange(PropertyChangeEvent ev)
throws PropertyVetoException {
    VetoableChangeListener l = (VetoableChangeListener) super.get(ev);

    if (l != null) {
        l.vetoableChange(ev);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:WeakListenerImpl.java


注:本文中的java.beans.VetoableChangeListener.vetoableChange方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。