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


Java VetoableChangeSupport.removeVetoableChangeListener方法代码示例

本文整理汇总了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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:VetoableChangeSupportTest.java

示例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]);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:22,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:19,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:18,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:17,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:21,代码来源:VetoableChangeSupportTest.java

示例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]);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:13,代码来源:VetoableChangeSupportTest.java

示例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);
}
 
开发者ID:shannah,项目名称:cn1,代码行数:16,代码来源:VetoableChangeSupportTest.java


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