Examples of firePropertyChange()


Examples of java.beans.PropertyChangeSupport.firePropertyChange()

        PropertyChangeSupport sup = new PropertyChangeSupport(new Object());
        PropertyChangeEvent event = new PropertyChangeEvent(new Object(),
                "myProp", new Object(), new Object());

        sup.addPropertyChangeListener(null);
        sup.firePropertyChange(event);
    }

    /*
     * Test the method firePropertyChange(String, boolean, boolean) with normal
     * parameters, when there is a listener for all properties and another for
View Full Code Here

Examples of java.beans.PropertyEditorSupport.firePropertyChange()

    public void testAddPropertyChangeListener() {
        MockTarget target = new MockTarget();
        PropertyEditorSupport support = new PropertyEditorSupport();
        support.addPropertyChangeListener(EventHandler.create(
                PropertyChangeListener.class, target, "setCalled"));
        support.firePropertyChange();

        assertEquals("called", target.getLabel());
    }

    public void testAddPropertyChangeListener_source() {
View Full Code Here

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

        support.addPropertyChangeListener(propName, l1);
        support.addPropertyChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(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.firePropertyChange()

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

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

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

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

        support.removePropertyChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(propName, oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);

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

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

    public void testAddPropertyChangeListener_NullParam() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
        support.addPropertyChangeListener(null, new MockPropertyChangeListener());
        support.addPropertyChangeListener("property name", null);
        support.firePropertyChange("property name", "old value",
                "new value");
    }

    public void testAddPropertyChangeListener() {
        BeanContextChildSupport support = new MockBeanContextChildSupport();
View Full Code Here

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

        Object oldValue = new Integer(1);
        Object newValue = new Integer(5);

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

        support.addPropertyChangeListener(propName, l1);
        l1.clearLastEvent();
View Full Code Here

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

        assertNull(l2.lastEvent);

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

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

        assertNull(l2.lastEvent);

        support.addPropertyChangeListener(propName, l2);
        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange(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.firePropertyChange()

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

        l1.clearLastEvent();
        l2.clearLastEvent();
        support.firePropertyChange("xxx", oldValue, newValue);
        assertNull(l1.lastEvent);
        assertNull(l2.lastEvent);
    }

    public void testAddVetoableChangeListener_NullParam()
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.