當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。