本文整理汇总了Java中java.beans.VetoableChangeSupport.removeVetoableChangeListener方法的典型用法代码示例。如果您正苦于以下问题:Java VetoableChangeSupport.removeVetoableChangeListener方法的具体用法?Java VetoableChangeSupport.removeVetoableChangeListener怎么用?Java VetoableChangeSupport.removeVetoableChangeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.beans.VetoableChangeSupport
的用法示例。
在下文中一共展示了VetoableChangeSupport.removeVetoableChangeListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRemoveVetoableChangeListenerStringVetoableChangeListener_property
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_property() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
support.removeVetoableChangeListener(propertyName, proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}
示例2: testRemoveVetoableChangeListenerStringVetoableChangeListener_property_more
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_property_more() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
support.addVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(2, support.getVetoableChangeListeners(propertyName).length);
support.removeVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例3: testRemoveVetoableChangeListenerStringVetoableChangeListener_property_diff
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_property_diff() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
VetoableChangeListener proxy2 = EventHandler.create(
VetoableChangeListener.class, source, "getText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
support.addVetoableChangeListener(propertyName, proxy2);
assertTrue(support.hasListeners(propertyName));
assertEquals(2, support.getVetoableChangeListeners(propertyName).length);
support.removeVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
assertSame(proxy2, support.getVetoableChangeListeners(propertyName)[0]);
}
示例4: testRemoveVetoableChangeListenerStringVetoableChangeListener_listener_diff
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_listener_diff() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
VetoableChangeListener proxy2 = EventHandler.create(
VetoableChangeListener.class, source, "getText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
support.removeVetoableChangeListener(propertyName, proxy2);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例5: testRemoveVetoableChangeListenerStringVetoableChangeListener_listener_null
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_listener_null() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, null);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
support.removeVetoableChangeListener(propertyName, proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}
示例6: testRemoveVetoableChangeListenerStringVetoableChangeListener_all
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_all() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
support.removeVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例7: testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_Invalid
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_Invalid() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
support.removeVetoableChangeListener(propertyName + "_invalid", proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例8: testRemoveVetoableChangeListenerVetoableChangeListener_invalid
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_invalid() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners().length);
support.removeVetoableChangeListener(proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}
示例9: testRemoveVetoableChangeListenerVetoableChangeListener_all
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_all() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
support.removeVetoableChangeListener(proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}
示例10: testRemoveVetoableChangeListenerVetoableChangeListener_all_more
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_all_more() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(proxy);
support.addVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(2, support.getVetoableChangeListeners().length);
support.removeVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例11: testRemoveVetoableChangeListenerVetoableChangeListener_all_more_diff
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_all_more_diff() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
VetoableChangeListener proxy2 = EventHandler.create(
VetoableChangeListener.class, source, "getText");
String propertyName = "label";
support.addVetoableChangeListener(proxy);
support.addVetoableChangeListener(proxy2);
assertTrue(support.hasListeners(propertyName));
assertEquals(2, support.getVetoableChangeListeners().length);
support.removeVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
assertEquals(proxy2, support.getVetoableChangeListeners()[0]);
}
示例12: testRemoveVetoableChangeListenerVetoableChangeListener_all_null
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_all_null() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(null);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners().length);
support.removeVetoableChangeListener(proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}
示例13: testRemoveVetoableChangeListenerVetoableChangeListener_property
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerVetoableChangeListener_property() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener("label", proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners().length);
support.removeVetoableChangeListener(proxy);
assertTrue(support.hasListeners(propertyName));
assertEquals(1, support.getVetoableChangeListeners(propertyName).length);
assertEquals(1, support.getVetoableChangeListeners().length);
}
示例14: testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_Null
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_Null() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
support.addVetoableChangeListener(propertyName, proxy);
assertTrue(support.hasListeners(propertyName));
support.removeVetoableChangeListener(null, proxy);
}
示例15: testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_NoListener
import java.beans.VetoableChangeSupport; //导入方法依赖的package包/类
public void testRemoveVetoableChangeListenerStringVetoableChangeListener_propertyName_NoListener() {
MockSource source = new MockSource();
VetoableChangeSupport support = new VetoableChangeSupport(source);
VetoableChangeListener proxy = EventHandler.create(
VetoableChangeListener.class, source, "setText");
String propertyName = "label";
assertFalse(support.hasListeners(propertyName));
support.removeVetoableChangeListener(propertyName, proxy);
assertFalse(support.hasListeners(propertyName));
assertEquals(0, support.getVetoableChangeListeners(propertyName).length);
assertEquals(0, support.getVetoableChangeListeners().length);
}