Examples of fireVetoableChange()


Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

        String propertyName = "label_invalid";
        support.addVetoableChangeListener(propertyName, proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(source, "label",
                "Label: old", "Label: new");
        support.fireVetoableChange(event);

        assertEquals("text.default", source.getText());
    }

    /*
 
View Full Code Here

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

        support.addVetoableChangeListener(proxy);
        support.addVetoableChangeListener(proxy2);

        PropertyChangeEvent event = new PropertyChangeEvent(source, "label",
                "Label: old", "Label: new");
        support.fireVetoableChange(event);
        assertEquals(2, source.getTop());
        assertEquals("called", source.getText());
    }

    /*
 
View Full Code Here

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        support.addVetoableChangeListener(null);
        PropertyChangeEvent event = new PropertyChangeEvent(source, "label",
                "Label: old", "Label: new");
            support.fireVetoableChange(event);
    }

    /*
     * Class under test for void fireVetoableChange(String, boolean, boolean)
     */
 
View Full Code Here

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener(proxy);
        support.fireVetoableChange("label", true, false);

        assertEquals("called", source.getText());
    }

    /*
 
View Full Code Here

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        support.addVetoableChangeListener(null);
            support.fireVetoableChange("label", true, false);
    }

    /*
     * register listener for property "label".
     */
 
View Full Code Here

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange("label", true, false);

        assertEquals("called", source.getText());
    }

    /*
 
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport.fireVetoableChange()

        support.addVetoableChangeListener(propName, l1);
        support.addVetoableChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertEquals(propName, l1.lastEvent.getPropertyName());
        assertSame(oldValue, l1.lastEvent.getOldValue());
        assertSame(newValue, l1.lastEvent.getNewValue());
        assertSame(support, l1.lastEvent.getSource());
        assertEquals(propName, l2.lastEvent.getPropertyName());
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport.fireVetoableChange()

        assertSame(support, l2.lastEvent.getSource());

        support.removeVetoableChangeListener(propName, l1);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertEquals(l2.lastEvent.getPropertyName(), propName);
        assertSame(l2.lastEvent.getOldValue(), oldValue);
        assertSame(l2.lastEvent.getNewValue(), newValue);
        assertSame(l2.lastEvent.getSource(), support);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport.fireVetoableChange()

        assertSame(l2.lastEvent.getSource(), support);

        support.removeVetoableChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.fireVetoableChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);

        // remove not-registered listener
        support.removeVetoableChangeListener(propName, l1);
View Full Code Here

Examples of java.beans.beancontext.BeanContextChildSupport.fireVetoableChange()

            throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.addVetoableChangeListener(null,
                new MockVetoableChangeListener());
        support.addVetoableChangeListener("property name", null);
        support.fireVetoableChange("property name", "old value", "new value");
    }

    public void testAddVetoableChangeListener() throws PropertyVetoException {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        MockVetoableChangeListener l1 = new MockVetoableChangeListener();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.