Package java.beans

Examples of java.beans.PropertyVetoException


     * @see java.beans.VetoableChangeListener#vetoableChange(java.beans.PropertyChangeEvent)
     */
    public void vetoableChange(PropertyChangeEvent evt)
            throws PropertyVetoException {
        lastEvent = evt;
        throw new PropertyVetoException("NO CHANGE ALLOWED", evt);
    }
View Full Code Here


        super.tearDown();
    }

    public void testPropertyVetoException() {
        String message = "testPropertyVetoException";
        PropertyVetoException e = new PropertyVetoException(message, event);
        assertSame(message, e.getMessage());
        assertSame(event, e.getPropertyChangeEvent());
    }
View Full Code Here

        assertSame(event, e.getPropertyChangeEvent());
    }

    public void testPropertyVetoException_MessageNull() {
        String message = null;
        PropertyVetoException e = new PropertyVetoException(message, event);
        assertNull(e.getMessage());
        assertSame(event, e.getPropertyChangeEvent());
    }
View Full Code Here

        assertSame(event, e.getPropertyChangeEvent());
    }

    public void testPropertyVetoException_EventNull() {
        String message = "testPropertyVetoException";
        PropertyVetoException e = new PropertyVetoException(message, null);
        assertSame(message, e.getMessage());
        assertNull(e.getPropertyChangeEvent());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new PropertyVetoException(
                "testPropertyVetoException", event), comparator);
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new PropertyVetoException(
                "testPropertyVetoException", event), comparator);
    }
View Full Code Here

        PropertyChangeEvent event = new PropertyChangeEvent(new Beans(),
                "propertyName", "oldValue", "newValue");

        String message = "test message";

        PropertyVetoException e = new PropertyVetoException(message, event);
        assertEquals(message, e.getMessage());
    }
View Full Code Here

            if (false) {
                System.out.println(prefix + " old: " + event.getOldValue()
                        + " new: " + event.getNewValue());
            }
            if (veto) {
                throw new PropertyVetoException("Veto Change", event);
            }
        }
View Full Code Here

            event = e;
            String propName = e.getPropertyName();

            if (propName.equals(vetoedPropName)
                    && e.getNewValue().equals(new Integer(1))) {
                throw new PropertyVetoException(
                        propName + " change is vetoed!", e);
            }
        }
View Full Code Here

            // PropertyVetoException if it was not successful
            if (!validatePendingSetBeanContext(bc)) {
                this.rejectedSetBCOnce = true;
                fireVetoableChange(BEAN_CONTEXT, this.beanContext, bc);

                throw new PropertyVetoException(Messages.getString("beans.0F"), //$NON-NLS-1$
                        new PropertyChangeEvent(this.beanContextChildPeer,
                                BEAN_CONTEXT, this.beanContext, bc));
            }
            this.rejectedSetBCOnce = false;
View Full Code Here

TOP

Related Classes of java.beans.PropertyVetoException

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.