本文整理汇总了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)
}
}
}
}
示例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;
}
示例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);
}
}