Package javax.swing.event.SwingPropertyChangeSupportTest

Examples of javax.swing.event.SwingPropertyChangeSupportTest.ConcreteVetoableChangeListener


        assertTrue(str != null);
        assertTrue(str != "");
    }

    public void testRemoveVetoableChangeListener() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener3 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        panel.addVetoableChangeListener(changeListener1);
        panel.addVetoableChangeListener(changeListener2);
        panel.addVetoableChangeListener(changeListener3);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 1);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 2);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 0);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener1);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 1);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener3);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 0);
    }
View Full Code Here


        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 0);
    }

    public void testAddVetoableChangeListener() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        panel.addVetoableChangeListener(changeListener1);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 1);
        assertEquals(0, panel.listenerList.getListeners(VetoableChangeListener.class).length);
        assertEquals(1, panel.getListeners(VetoableChangeListener.class).length);
        assertTrue(changeListener1.findMe(listenersArray) > 0);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 2);
        assertTrue(changeListener1.findMe(listenersArray) > 0);
        assertTrue(changeListener2.findMe(listenersArray) > 0);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
    }
View Full Code Here

        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
    }

    public void testGetVetoableChangeListeners() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener3 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray != null && listenersArray.length == 0);
        panel.addVetoableChangeListener(changeListener1);
        panel.addVetoableChangeListener(changeListener2);
        panel.addVetoableChangeListener(changeListener3);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 4);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 2);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
    }
View Full Code Here

        panel = new JRootPane();
        assertTrue("JRootPane is DoubleBuffered", panel.isDoubleBuffered());
    }

    public void testFireVetoableChange() throws PropertyVetoException {
        ConcreteVetoableChangeListener changeListener = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray != null && listenersArray.length == 0);
        panel.addVetoableChangeListener(changeListener);
        JPanel button1 = new JPanel();
View Full Code Here

        assertTrue(str != null);
        assertTrue(str != "");
    }

    public void testRemoveVetoableChangeListener() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener3 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        panel.addVetoableChangeListener(changeListener1);
        panel.addVetoableChangeListener(changeListener2);
        panel.addVetoableChangeListener(changeListener3);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 1);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 2);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 0);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener1);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 1);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
        panel.removeVetoableChangeListener(changeListener3);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 0);
    }
View Full Code Here

        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 0);
    }

    public void testAddVetoableChangeListener() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        panel.addVetoableChangeListener(changeListener1);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 1);
        assertEquals(0, panel.listenerList.getListeners(VetoableChangeListener.class).length);
        assertEquals(1, panel.getListeners(VetoableChangeListener.class).length);
        assertTrue(changeListener1.findMe(listenersArray) > 0);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 2);
        assertTrue(changeListener1.findMe(listenersArray) > 0);
        assertTrue(changeListener2.findMe(listenersArray) > 0);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
    }
View Full Code Here

        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 3);
    }

    public void testGetVetoableChangeListeners() {
        ConcreteVetoableChangeListener changeListener1 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener2 = new ConcreteVetoableChangeListener();
        ConcreteVetoableChangeListener changeListener3 = new ConcreteVetoableChangeListener();
        VetoableChangeListener[] listenersArray = null;
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray != null && listenersArray.length == 0);
        panel.addVetoableChangeListener(changeListener1);
        panel.addVetoableChangeListener(changeListener2);
        panel.addVetoableChangeListener(changeListener3);
        panel.addVetoableChangeListener(changeListener2);
        listenersArray = panel.getVetoableChangeListeners();
        assertTrue(listenersArray.length == 4);
        assertTrue(changeListener1.findMe(listenersArray) == 1);
        assertTrue(changeListener2.findMe(listenersArray) == 2);
        assertTrue(changeListener3.findMe(listenersArray) == 1);
    }
View Full Code Here

TOP

Related Classes of javax.swing.event.SwingPropertyChangeSupportTest.ConcreteVetoableChangeListener

Copyright © 2018 www.massapicom. 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.