Package java.beans

Examples of java.beans.PropertyChangeSupport.firePropertyChange()


                                      boolean oldValue, boolean newValue) {
        PropertyChangeSupport changeSupport = this.changeSupport;
        if (changeSupport == null || oldValue == newValue) {
            return;
        }
        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
    }

    /**
     * Support for reporting bound property changes for integer properties.
     * This method can be called when a bound property has changed and it will
View Full Code Here


                                      int oldValue, int newValue) {
        PropertyChangeSupport changeSupport = this.changeSupport;
        if (changeSupport == null || oldValue == newValue) {
            return;
        }
        changeSupport.firePropertyChange(propertyName, oldValue, newValue);
    }

    /**
     * Reports a bound property change.
     *
 
View Full Code Here

    public void testPropertyChangePropertyChangeEvent() {
        BeanContextServicesSupport s = new BeanContextServicesSupport();
        PropertyChangeSupport p= new PropertyChangeSupport(new Object());

        p.addPropertyChangeListener(s);
        p.firePropertyChange(null, new Object(), new Object());
    }
   
    //Regression Test for HARMONY-3757
    public void testSelfSerializatoin() throws Exception {
        BeanContextSupport beanContextSupport = new BeanContextSupport();
View Full Code Here

            if (propertyChangeSupport == null) {
                return;
            }
            pcs = propertyChangeSupport;
        }
        pcs.firePropertyChange(propertyName, oldValue, newValue);
    }

    protected void firePropertyChange(String propertyName, int oldValue, int newValue) {
        firePropertyChangeImpl(propertyName, new Integer(oldValue), new Integer(newValue));
    }
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "action1");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("action1", target.getActionRecord());
    }

    public void testInvoke_extend1_1() {
        MockFish fish = new MockFish();
View Full Code Here

                target, "action4");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        try {
            support.firePropertyChange(event);
        } catch (Exception e) {

        }
        assertEquals("action4", target.getActionRecord());
    }
View Full Code Here

                target, "action2");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        try {
            support.firePropertyChange(event);
            fail("Should throw exception");
        } catch (Exception e) {
            // e.printStackTrace();
        }
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "a", "source.a");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend4() {
        MockFish fish = new MockFish();
View Full Code Here

        Object proxy = EventHandler.create(PropertyChangeListener.class,
                target, "b", "source.a");
        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("Boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend4_BooleanObject() {
        MockFish fish = new MockFish();
View Full Code Here

                target, "a", "source.booleanObject");

        support.addPropertyChangeListener((PropertyChangeListener) proxy);
        PropertyChangeEvent event = new PropertyChangeEvent(fish, "name", "1",
                "5");
        support.firePropertyChange(event);
        assertEquals("boolean:true", target.getActionRecord());
    }

    public void testInvoke_extend5() {
        MockFish fish = new MockFish();
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.