|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.beans.AbstractProperty
public abstract class AbstractProperty
Provides support for JavaBean properties -- both vetoable and non-vetoable. This implementation conserves memory by allocating storage for property change listeners only when the first property change listener is added).
| Constructor Summary | |
|---|---|
protected |
AbstractProperty(Object sourceBean,
String name)
Constructs an instance. |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. |
abstract void |
addVetoableChangeListener(VetoableChangeListener listener)
Adds a VetoableChangeListener. |
void |
clearValue()
This clears the current and previous value without notifying listeners |
String |
getName()
Gets the name of the property. |
Object |
getSourceBean()
Gets the source bean of the property. |
Object |
getValue()
Gets the property value. |
boolean |
isReporting()
Indicates if the property is reporting changes. |
abstract boolean |
isVetoable()
Indicates if changes to this property can be vetoed. |
void |
notifyListeners()
Reports changes to the Property. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener. |
abstract void |
removeVetoableChangeListener(VetoableChangeListener listener)
Removes a VetoableChangeListener. |
protected void |
setCurrentValue(Object newValue)
Sets the current value. |
void |
setReporting(boolean reportChanges)
Enables or disables the reporting of property changes. |
abstract void |
setValue(Object newValue)
Sets the property value. |
abstract void |
setValueAndNotifyListeners(Object newValue)
Sets the property value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractProperty(Object sourceBean,
String name)
sourceBean - The source bean of the property.name - The name of the property.| Method Detail |
|---|
public final Object getSourceBean()
getSourceBean in interface Propertypublic final String getName()
getName in interface Propertypublic Object getValue()
getValue in interface Propertypublic void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface Propertylistener - The PropertyChangeListener to add.public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface Propertylistener - The PropertyChangeListener to remove.
public abstract void addVetoableChangeListener(VetoableChangeListener listener)
throws UnsupportedOperationException
addVetoableChangeListener in interface Propertylistener - The VetoableChangeListener to add.
UnsupportedOperationException - This operation is unsupported for this
type of Property.public abstract void removeVetoableChangeListener(VetoableChangeListener listener)
removeVetoableChangeListener in interface Propertylistener - The VetoableChangeListener to remove.public abstract boolean isVetoable()
isVetoable in interface Property
public abstract void setValueAndNotifyListeners(Object newValue)
throws PropertyVetoException
isReporting() is true. Will always notify any, registered,
VetoableChangeListener-s.
setValueAndNotifyListeners in interface PropertynewValue - The new property value.
PropertyVetoException - A registered VetoableChangeListener objected
to the change. The change was not committed.
public abstract void setValue(Object newValue)
throws PropertyVetoException
setValue in interface PropertynewValue - The new property value.
PropertyVetoException - A registered VetoableChangeListener objected
to the change. The change was not committed.protected final void setCurrentValue(Object newValue)
newValue - The new property value.public final void setReporting(boolean reportChanges)
setReporting in interface PropertyreportChanges - Whether to enable or disable property change
reporting.public final boolean isReporting()
isReporting in interface Propertypublic final void notifyListeners()
isReporting() is true and the current value of the property
is not equal to the previously-reported value.
notifyListeners in interface Propertypublic void clearValue()
clearValue in interface Property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||