com.miginfocom.beans
Class AbstractBean

java.lang.Object
  extended by com.miginfocom.beans.AbstractBean
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AbstractHeaderBean, ActivityAShapeBean, ActivityGridLayoutBean, GridDimensionLayoutBean

public abstract class AbstractBean
extends java.lang.Object
implements java.io.Serializable

Some basic functionality for JavaBeans in the MiG Calendar component.

See Also:
Serialized Form

Constructor Summary
protected AbstractBean()
           
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a listener that gets notified when a property has changed.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l, boolean asWeakRef)
          Adds a listener that gets notified when a property has changed.
protected  boolean firePropertyChange(java.lang.String propName, boolean oldValue, boolean newValue)
          Fires a property change event to the listeners
protected  boolean firePropertyChange(java.lang.String propName, int oldValue, int newValue)
          Fires a property change event to the listeners
protected  boolean firePropertyChange(java.lang.String propName, java.lang.Object oldValue, java.lang.Object newValue)
          Fires a property change event to the listeners
 boolean firePropertyChangeEvent(java.beans.PropertyChangeEvent e)
          Fires a property change event to the listeners
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes the listener, if it is in the list.
 boolean setIgnorePropertyChangeEvents(boolean b)
          Sets if PropertyChangeEvent's should be fired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractBean

protected AbstractBean()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a listener that gets notified when a property has changed. Not as weak ref.

Parameters:
l - The listener. Not null

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l,
                                      boolean asWeakRef)
Adds a listener that gets notified when a property has changed.

Parameters:
l - The listener. Not null
asWeakRef - If the listener should be added wrapped in a WeakReference. This defers memory leak problems since the garbage collector can collect the listener if it is only referenced from this list.
Note! This (weak reference) can not be used with listeners that doesn't have another real (a.k.a Strong) reference to it, as for instance an annonymous inner class. If one such listener is added it will be removed almost immediately by the garbage collector.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes the listener, if it is in the list.

Parameters:
l - The listener to remove, not null.

setIgnorePropertyChangeEvents

public boolean setIgnorePropertyChangeEvents(boolean b)
Sets if PropertyChangeEvent's should be fired. Can be set to false if batch updates will occur for instance.
Use with causion though since one never know who's listening.

Parameters:
b - true or false...
Returns:
The old value.

firePropertyChange

protected boolean firePropertyChange(java.lang.String propName,
                                     boolean oldValue,
                                     boolean newValue)
Fires a property change event to the listeners

Returns:
If there was any listeners registered.

firePropertyChange

protected boolean firePropertyChange(java.lang.String propName,
                                     int oldValue,
                                     int newValue)
Fires a property change event to the listeners

Returns:
If there was any listeners registered.

firePropertyChange

protected boolean firePropertyChange(java.lang.String propName,
                                     java.lang.Object oldValue,
                                     java.lang.Object newValue)
Fires a property change event to the listeners

Returns:
If there was any listeners registered.

firePropertyChangeEvent

public boolean firePropertyChangeEvent(java.beans.PropertyChangeEvent e)
Fires a property change event to the listeners

Returns:
If there was any listeners registered.


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.