Package java.beans

Examples of java.beans.PropertyChangeSupport.removePropertyChangeListener()


        @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


                        public void addPropertyChangeListener(PropertyChangeListener listener) {
                            pcs.addPropertyChangeListener(listener);
                        }

                        public void removePropertyChangeListener(PropertyChangeListener listener) {
                            pcs.removePropertyChangeListener(listener);
                        }

                        public void propertyChange(PropertyChangeEvent ev) {
                            String prop = ev.getPropertyName();
                            if (prop == null || prop.equals(ProjectProperties.INCLUDES) || prop.equals(ProjectProperties.EXCLUDES)) {
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

        sup.addPropertyChangeListener(l1);

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