classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] java.beans.PropertyEditorSupport - update to 1.5


From: Robert Schuster
Subject: [cp-patches] java.beans.PropertyEditorSupport - update to 1.5
Date: Sun, 31 Oct 2004 21:59:59 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.3) Gecko/20040930

This patch updates PropertyEditorSupport to 1.5 . No new language features are used:

- made constructors public
- added getSource(), setSource(Object)

(general documentation and indentation cleanup of this class is the next on my list)

cu
Robert
Index: ChangeLog
===================================================================
RCS file: /cvsroot/classpath/classpath/ChangeLog,v
retrieving revision 1.2722
diff -u -r1.2722 ChangeLog
--- ChangeLog   31 Oct 2004 20:21:57 -0000      1.2722
+++ ChangeLog   31 Oct 2004 20:54:54 -0000
@@ -1,5 +1,14 @@
 2004-10-31  Robert Schuster <address@hidden>
 
+       Updates to 1.5
+       * java/beans/PropertyEditorSupport.java
+       (PropertyEditorSupport()): Changed modifier to public
+       (PropertyEditorSupport(Object): Changed modifier to public
+       (setSource): New method
+       (getSource): New method
+
+2004-10-31  Robert Schuster <address@hidden>
+
        Fixes bug #10799
        * java/beans/PropertyEditorSupport.java
        (setValue): Fire property change event
Index: java/beans/PropertyEditorSupport.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/beans/PropertyEditorSupport.java,v
retrieving revision 1.6
diff -u -r1.6 PropertyEditorSupport.java
--- java/beans/PropertyEditorSupport.java       31 Oct 2004 20:21:57 -0000      
1.6
+++ java/beans/PropertyEditorSupport.java       31 Oct 2004 20:54:54 -0000
@@ -51,8 +51,8 @@
  **
  ** @author John Keiser
  ** @author Robert Schuster
- ** @since JDK1.1
- ** @status updated to 1.4
+ ** @since 1.1
+ ** @status updated to 1.5
  **/
 
 public class PropertyEditorSupport implements PropertyEditor {
@@ -62,8 +62,10 @@
 
        /** Call this constructor when you are deriving from
         ** PropertyEditorSupport.
+        ** @since 1.5
+        ** @status was <code>protected</code> prior to 1.5
         **/
-       protected PropertyEditorSupport() {
+       public PropertyEditorSupport() {
                this.eventSource = this;
                this.pSupport = new PropertyChangeSupport(this);
        }
@@ -72,8 +74,16 @@
         ** PropertyEditorSupport as a helper object.
         ** @param eventSource the source to use when firing
         **        property change events.
+        ** @since 1.5
+        ** @status was <code>protected</code> prior to 1.5
         **/
-       protected PropertyEditorSupport(Object eventSource) {
+       public PropertyEditorSupport(Object eventSource) {
+
+               // needed for compatibility with JDK 1.5.0
+               if(eventSource == null) {
+                       throw new NullPointerException();
+               }
+
                this.eventSource = eventSource;
                this.pSupport = new PropertyChangeSupport(this);
        }
@@ -204,5 +214,30 @@
        public void firePropertyChange() {
                pSupport.firePropertyChange(null,null,val);
        }
+
+  /** Returns the bean that is used as the source of events.
+   *
+   * @return The event source object
+   * @since 1.5
+   */
+  public Object getSource()
+  {
+    return eventSource;
+  }
+
+  /** Sets the bean that is used as the source of events
+   * when property changes occur.
+   *
+   * The event source bean is for informational purposes only
+   * and should not be changed by the <code>PropertyEditor</code>.
+   *
+   * @param source
+   * @since 1.5
+   */
+  public void setSource(Object source)
+  {
+    eventSource = source;
+  }
+
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]