Index: D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeListener.java =================================================================== --- D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeListener.java (revision 0) +++ D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeListener.java (revision 0) @@ -0,0 +1,39 @@ +/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package java.beans; + +import java.util.EventListener; + +/** + * The PropertyChangeListener listen for receiving + * PropertyChangeEvent. If a bean registers a + * PropertyChangeListener, when a "bound" property of the bean + * is changed, the listener method propertyChange will be called. + * + */ +public interface PropertyChangeListener extends EventListener { + + /** + * Invoked when a "bound" property is changed. + * + * @param event + * the fired event describing the property change. + */ + public void propertyChange(PropertyChangeEvent event); +} + + Index: D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeEvent.java =================================================================== --- D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeEvent.java (revision 0) +++ D:/user/jimmy/WorkSpace_Ongoing/Harmony Archive/src/main/java/java/beans/PropertyChangeEvent.java (revision 0) @@ -0,0 +1,136 @@ +/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +package java.beans; + +import java.io.Serializable; +import java.util.EventObject; + +/** + * A PropertyChangeEvent can be issued when the value of a bean + * property is changed. The old and new values of the property can be set in the + * event, both of which can be null to indicate that the values + * are unknown. + *

+ * The property name can also be null, indicating any changes to + * the bean's one or more properties. The old and new values should be + * null if the propertye name is null. + *

+ * + */ +public class PropertyChangeEvent extends EventObject implements Serializable { + + // Serialization version ID + static final long serialVersionUID = 7042693688939648123L; // J2SE 1.4.2 + + /** + * The name of the property whose value is changed. May be null. + * + * @serial + */ + private String propertyName; + + /** + * The new value of the property. + * + * @serial + */ + private Object newValue; + + /** + * The old value of the property. + * + * @serial + */ + private Object oldValue; + + /** + * Propagation ID. Reserved for future use. It is required at this time that + * the propagationId should be propagated from incoming + * events to outgoing events. + * + * @serial + */ + private Object propagationId; + + /** + * Constructs a PropertyChangeEvent object. + * + * @param source + * the bean issuing the event + * @param propertyName + * the name of changeed property + * @param oldValue + * the old value of the property + * @param newValue + * the new value of the property + * @throws IllegalArgumentException + * If source is null. + */ + public PropertyChangeEvent(Object source, String propertyName, + Object oldValue, Object newValue) { + super(source); + this.propertyName = propertyName; + this.newValue = newValue; + this.oldValue = oldValue; + } + + /** + * Gets the new value of the property. + */ + public Object getNewValue() { + return newValue; + } + + /** + * Gets the old value of the property. + * + * @return the old value of the property + */ + public Object getOldValue() { + return oldValue; + } + + /** + * Gets the propagated ID. + * + * @return the propagated ID + */ + public Object getPropagationId() { + return propagationId; + } + + /** + * Gets the name of the property. + * + * @return the name of the property + */ + public String getPropertyName() { + return propertyName; + } + + /** + * Sets the propagated ID. + * + * @param propagationId + * the ID to be propagated + */ + public void setPropagationId(Object propagationId) { + this.propagationId = propagationId; + } +} + +