Package java.beans

Examples of java.beans.PropertyChangeSupport.removePropertyChangeListener()


                PropertyChangeListener listener)
        {
            PropertyChangeSupport pcs = (PropertyChangeSupport)
                    AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
            if (null != pcs) {
                pcs.removePropertyChangeListener(propertyName, listener);
            }
        }

        @Override
        public synchronized PropertyChangeListener[] getPropertyChangeListeners()
View Full Code Here


        @Override
        public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
            PropertyChangeSupport pcs = (PropertyChangeSupport)
                    AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
            if (null != pcs) {
                pcs.removePropertyChangeListener(listener);
            }
        }

        /*
         * we do expect that all other fireXXX() methods of java.beans.PropertyChangeSupport
View Full Code Here

        synchronized (map) {
            pcs = (PropertyChangeSupport) map.get(propName);
            if (pcs == null) {
                return;
            }
            pcs.removePropertyChangeListener(l);
        }
    }

    protected void firePropertyChange(String propName,
            Object oldVal, Object newVal) {
View Full Code Here

                PropertyChangeListener listener)
        {
            PropertyChangeSupport pcs = (PropertyChangeSupport)
                    AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
            if (null != pcs) {
                pcs.removePropertyChangeListener(propertyName, listener);
            }
        }

        @Override
        public synchronized PropertyChangeListener[] getPropertyChangeListeners()
View Full Code Here

        @Override
        public synchronized void removePropertyChangeListener(PropertyChangeListener listener) {
            PropertyChangeSupport pcs = (PropertyChangeSupport)
                    AppContext.getAppContext().get(PROP_CHANGE_SUPPORT_KEY);
            if (null != pcs) {
                pcs.removePropertyChangeListener(listener);
            }
        }

        /*
         * we do expect that all other fireXXX() methods of java.beans.PropertyChangeSupport
View Full Code Here

        sup.addPropertyChangeListener(l1);

        assertEquals(1, sup.getPropertyChangeListeners().length);
        assertSame(l1, sup.getPropertyChangeListeners()[0]);

        sup.removePropertyChangeListener(l1);
        sup.addPropertyChangeListener(l3);
        assertEquals(1, sup.getPropertyChangeListeners().length);
        assertSame(l2, ((PropertyChangeListenerProxy) sup
                .getPropertyChangeListeners()[0]).getListener());
        assertNotSame(l3, sup.getPropertyChangeListeners()[0]);
View Full Code Here

        assertEquals(1, sup.getPropertyChangeListeners().length);
        assertSame(l2, ((PropertyChangeListenerProxy) sup
                .getPropertyChangeListeners()[0]).getListener());
        assertNotSame(l3, sup.getPropertyChangeListeners()[0]);

        sup.removePropertyChangeListener(sup.getPropertyChangeListeners()[0]);
        assertEquals(0, sup.getPropertyChangeListeners().length);
        sup.addPropertyChangeListener(l4);
        //RI asserts to true here, really strange behavior
        assertNotSame(l3, ((PropertyChangeListenerProxy) sup
                .getPropertyChangeListeners()[0]).getListener());
View Full Code Here

        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        assertSame(l1, ((PropertyChangeListenerProxy) listeners[0])
                .getListener());

        sup.removePropertyChangeListener(listeners[0]);
        sup.addPropertyChangeListener("myProp3", l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(1, listeners.length);
        // pay attention to this recursive proxy
        assertNotSame(l3, ((PropertyChangeListenerProxy) listeners[0])
View Full Code Here

        assertSame(l1, ((PropertyChangeListenerProxy) listeners[0])
                .getListener());
        assertSame(l1, ((PropertyChangeListenerProxy) listeners[1])
                .getListener());

        sup.removePropertyChangeListener(listeners[0]);
        sup.removePropertyChangeListener(listeners[1]);
        sup.addPropertyChangeListener("myProp3", l3);
        sup.addPropertyChangeListener("myProp3", l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(2, listeners.length);
View Full Code Here

                .getListener());
        assertSame(l1, ((PropertyChangeListenerProxy) listeners[1])
                .getListener());

        sup.removePropertyChangeListener(listeners[0]);
        sup.removePropertyChangeListener(listeners[1]);
        sup.addPropertyChangeListener("myProp3", l3);
        sup.addPropertyChangeListener("myProp3", l3);
        listeners = sup.getPropertyChangeListeners();
        assertEquals(2, listeners.length);
        assertSame(
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.