Package java.beans

Examples of java.beans.VetoableChangeSupport.fireVetoableChange()


        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener(proxy);
        support.fireVetoableChange("label", null, null);
        assertEquals("called", source.getText());
    }

    /*
     * Class under test for void fireVetoableChange(String, Object, Object)
View Full Code Here


        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange("label", "Label: old", "Label: new");
        assertEquals("called", source.getText());
    }

    /*
     * property name is null. register listener for one property - "label"
View Full Code Here

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange(null, "Label: old", "Label: new");
        assertEquals("text.default", source.getText());
    }

    /*
     * property name is invalid. register listener for one property - "label"
View Full Code Here

        VetoableChangeSupport vcs = new VetoableChangeSupport(this);
        MockVetoListener2 vlistener = new MockVetoListener2();

        vcs.addVetoableChangeListener(vlistener);
        try {
            vcs.fireVetoableChange(vlistener.vetoedPropName, 0, 1);
            fail("PropertyVetoException expected");
        } catch (PropertyVetoException ok) {
        }

        assertEquals(Integer.valueOf(1), vlistener.event.getOldValue());
View Full Code Here

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange("label_invalid", "Label: old", "Label: new");
        assertEquals("text.default", source.getText());
    }

    /*
     * oldValue=NewValue. register listener for one property - "label"
View Full Code Here

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener(proxy);
        support.fireVetoableChange("label", "Label: old", "Label: old");
        assertEquals("text.default", source.getText());
    }

    /*
     * oldValue=NewValue=null. register listener for one property - "label"
View Full Code Here

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label", proxy);
        support.fireVetoableChange("label", null, null);
        assertEquals("called", source.getText());
    }

    /*
     * register listener to an invalid property
View Full Code Here

        VetoableChangeSupport support = new VetoableChangeSupport(source);

        VetoableChangeListener proxy = EventHandler.create(
                VetoableChangeListener.class, source, "setText");
        support.addVetoableChangeListener("label_invalid", proxy);
        support.fireVetoableChange("label", "1", "2");
        assertEquals("text.default", source.getText());
    }

    public void testFireVetoableChangeException_revert_event() {
        final VetoableChangeSupport support = new VetoableChangeSupport(
View Full Code Here

                }
            }
        });

        try {
            support.fireVetoableChange("propName", 0, 1);
        } catch (PropertyVetoException pve) {
            assertEquals("Illegal sequence:" + sb, "abBaAb", sb.toString());
            String message = pve.getMessage();
            assertEquals("Illegal exception:" + message, B_THROW, message);
            return;
View Full Code Here

            return;
        }
        VetoableChangeSupport vetoableSupport =
            this.vetoableSupport;
        if (vetoableSupport != null) {
            vetoableSupport.fireVetoableChange(propertyName, oldValue,
                                               newValue);
        }
    }

    /**
 
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.