21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.beans; 27 28 import java.beans.*; 29 30 /** 31 * This is a support class to help build property editors. 32 * <p> 33 * It can be used either as a base class or as a delegate. 34 * 35 * @since 1.1 36 */ 37 38 public class PropertyEditorSupport implements PropertyEditor { 39 40 /** 41 * Constructs a <code>PropertyEditorSupport</code> object. 42 * 43 * @since 1.5 44 */ 45 public PropertyEditorSupport() { 46 setSource(this); 47 } 48 49 /** 50 * Constructs a <code>PropertyEditorSupport</code> object. 51 * 52 * @param source the source used for event firing 53 * @since 1.5 54 */ 55 public PropertyEditorSupport(Object source) { 56 if (source == null) { 57 throw new NullPointerException(); 58 } 59 setSource(source); 60 } 61 62 /** 63 * Returns the bean that is used as the 64 * source of events. If the source has not 65 * been explicitly set then this instance of 66 * <code>PropertyEditorSupport</code> is returned. 67 * 68 * @return the source object or this instance 69 * @since 1.5 70 */ 71 public Object getSource() { 72 return source; 73 } 74 75 /** 76 * Sets the source bean. 77 * <p> 78 * The source bean is used as the source of events 79 * for the property changes. This source should be used for information 80 * purposes only and should not be modified by the PropertyEditor. 81 * 82 * @param source source object to be used for events 83 * @since 1.5 84 */ 85 public void setSource(Object source) { 86 this.source = source; | 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 package java.beans; 27 28 import java.beans.*; 29 30 /** 31 * This is a support class to help build property editors. 32 * <p> 33 * It can be used either as a base class or as a delegate. 34 * 35 * @since 1.1 36 */ 37 38 public class PropertyEditorSupport implements PropertyEditor { 39 40 /** 41 * Constructs a {@code PropertyEditorSupport} object. 42 * 43 * @since 1.5 44 */ 45 public PropertyEditorSupport() { 46 setSource(this); 47 } 48 49 /** 50 * Constructs a {@code PropertyEditorSupport} object. 51 * 52 * @param source the source used for event firing 53 * @since 1.5 54 */ 55 public PropertyEditorSupport(Object source) { 56 if (source == null) { 57 throw new NullPointerException(); 58 } 59 setSource(source); 60 } 61 62 /** 63 * Returns the bean that is used as the 64 * source of events. If the source has not 65 * been explicitly set then this instance of 66 * {@code PropertyEditorSupport} is returned. 67 * 68 * @return the source object or this instance 69 * @since 1.5 70 */ 71 public Object getSource() { 72 return source; 73 } 74 75 /** 76 * Sets the source bean. 77 * <p> 78 * The source bean is used as the source of events 79 * for the property changes. This source should be used for information 80 * purposes only and should not be modified by the PropertyEditor. 81 * 82 * @param source source object to be used for events 83 * @since 1.5 84 */ 85 public void setSource(Object source) { 86 this.source = source; |