Package java.beans

Examples of java.beans.VetoableChangeListener


    public void testFireVetoableChangeStringbooleanboolean()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener(proxy);
        support.fireVetoableChange("label", true, false);

        assertEquals("called", source.getText());
View Full Code Here


    public void testFireVetoableChangeStringbooleanboolean_property()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange("label", true, false);

        assertEquals("called", source.getText());
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_twoListeners()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        VetoableChangeListener proxy2 = EventHandler.create(
                VetoableChangeListener.class, source, "increaseTop");
        support.addVetoableChangeListener(proxy);
        support.addVetoableChangeListener(proxy2);

        support.fireVetoableChange("label", true, false);
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_property_twoListeners()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        VetoableChangeListener proxy2 = EventHandler.create(
                VetoableChangeListener.class, source, "increaseTop");
        support.addVetoableChangeListener("label", proxy);
        support.addVetoableChangeListener("label", proxy2);

        support.fireVetoableChange("label", true, false);
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_Property_null()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "label", "source.text");
        support.addVetoableChangeListener(proxy);
        support.fireVetoableChange(null, true, false);
        assertEquals(source.getText(), source.getLabel());
    }
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_listener_Property_null()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "label", "source.text");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange(null, true, false);
        assertEquals("label.default", source.getLabel());
    }
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_listener_Null_Property_null()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "label", "source.text");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange(null, true, false);
        assertEquals("label.default", source.getLabel());
    }
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_Property_invalid()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "label", "source.text");
        support.addVetoableChangeListener(proxy);
        String newText = "new Text value";
        source.setText(newText);
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_listener_Property_invalid()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "label", "source.text");
        support.addVetoableChangeListener("label", proxy);
        String newText = "new Text value";
        source.setText(newText);
View Full Code Here

    public void testFireVetoableChangeStringbooleanboolean_SameValue()
            throws PropertyVetoException {
        MockSource source = new MockSource();
        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener(proxy);

        support.fireVetoableChange("label", true, true);
        assertEquals("text.default", source.getText());
View Full Code Here

TOP

Related Classes of java.beans.VetoableChangeListener

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.