home *** CD-ROM | disk | FTP | other *** search
- package java.beans;
-
- import java.awt.Component;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import java.util.Vector;
-
- public class PropertyEditorSupport implements PropertyEditor {
- private Object value;
- private Object source;
- private Vector listeners;
-
- protected PropertyEditorSupport() {
- this.source = this;
- }
-
- protected PropertyEditorSupport(Object var1) {
- this.source = var1;
- }
-
- public void setValue(Object var1) {
- this.value = var1;
- this.firePropertyChange();
- }
-
- public Object getValue() {
- return this.value;
- }
-
- public boolean isPaintable() {
- return false;
- }
-
- public void paintValue(Graphics var1, Rectangle var2) {
- }
-
- public String getJavaInitializationString() {
- return "???";
- }
-
- public String getAsText() {
- return this.value instanceof String ? (String)this.value : String.valueOf(this.value);
- }
-
- public void setAsText(String var1) throws IllegalArgumentException {
- if (this.value instanceof String) {
- this.setValue(var1);
- } else {
- throw new IllegalArgumentException(var1);
- }
- }
-
- public String[] getTags() {
- return null;
- }
-
- public Component getCustomEditor() {
- return null;
- }
-
- public boolean supportsCustomEditor() {
- return false;
- }
-
- public synchronized void addPropertyChangeListener(PropertyChangeListener var1) {
- if (this.listeners == null) {
- this.listeners = new Vector();
- }
-
- this.listeners.addElement(var1);
- }
-
- public synchronized void removePropertyChangeListener(PropertyChangeListener var1) {
- if (this.listeners != null) {
- this.listeners.removeElement(var1);
- }
- }
-
- public void firePropertyChange() {
- synchronized(this){}
-
- Vector var1;
- try {
- if (this.listeners == null) {
- return;
- }
-
- var1 = (Vector)this.listeners.clone();
- } catch (Throwable var6) {
- throw var6;
- }
-
- PropertyChangeEvent var2 = new PropertyChangeEvent(this.source, (String)null, (Object)null, (Object)null);
-
- for(int var3 = 0; var3 < var1.size(); ++var3) {
- PropertyChangeListener var4 = (PropertyChangeListener)var1.elementAt(var3);
- var4.propertyChange(var2);
- }
-
- }
- }
-