/*
 * provaBean.java
 *
 * Created on 7 febbraio 2000, 16.26
 */
 
package provaBean;

import java.beans.*;

/** 
 *
 * @author  giovanni
 * @version 
 */
public class provaBean extends Object implements java.io.Serializable {

  private static final String PROP_SAMPLE_PROPERTY = "SampleProperty"; 

  private String sampleProperty;

  private PropertyChangeSupport propertySupport;

  /** Utility field holding the ActionListener. */
  private transient java.awt.event.ActionListener actionListener = null;
  /** Creates new provaBean */
  public provaBean() {
    propertySupport = new PropertyChangeSupport ( this );
    fireActionListenerActionPerformed(new java.awt.event.ActionEvent());
  }

  public String getSampleProperty () {
    return sampleProperty;
  }
  
  public void setSampleProperty (String value) {
    String oldValue = sampleProperty;
    sampleProperty = value;
    propertySupport.firePropertyChange (PROP_SAMPLE_PROPERTY, oldValue, sampleProperty);
  }


  public void addPropertyChangeListener (PropertyChangeListener listener) {
    propertySupport.addPropertyChangeListener (listener);
  }

  public void removePropertyChangeListener (PropertyChangeListener listener) {
    propertySupport.removePropertyChangeListener (listener);
  }

  /** Registers ActionListener to receive events.
   * @param listener The listener to register.
   */
  public synchronized void addActionListener(java.awt.event.ActionListener listener) {
    if (actionListener != null) {
      throw new java.util.TooManyListenersException ();
    }
    actionListener = listener;
  }
  /** Removes ActionListener from the list of listeners.
   * @param listener The listener to remove.
   */
  public synchronized void removeActionListener(java.awt.event.ActionListener listener) {
    actionListener = null;
  }
  /** Notifies the registered listener about the event.
   *
   * @param e The event to be fired
   */
  private void fireActionListenerActionPerformed(java.awt.event.ActionEvent event) {
    actionListener.actionPerformed (event);
  }
}