Package it.tidalwave.ui.core
Class BoundProperty<T>
java.lang.Object
it.tidalwave.ui.core.BoundProperty<T>
- All Implemented Interfaces:
ChangingSource<T>,Mutable,Changeable<T>
- Since:
- 2.0-ALPHA-1
- Author:
- Fabrizio Giudici
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbind(ChangingSource<T> source) Binds this property to aChangingSource.get()Returns the value of this object.static <T> BoundProperty<T> of(T value) Creates a newBoundPropertywith the given initial value.voidSets a new value to this object.voidRemoves all the bindings of this object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface it.tidalwave.ui.core.ChangingSource
getPropertyChangeListenersMethods inherited from interface it.tidalwave.ui.core.Mutable
addListener, addListener1, addListener2, addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, hasListeners, removeListener, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
PROP_VALUE
- See Also:
-
-
Constructor Details
-
BoundProperty
public BoundProperty()
-
-
Method Details
-
of
Creates a newBoundPropertywith the given initial value.- Type Parameters:
T- the type of the property- Parameters:
value- the initial value- Returns:
- the property
- Since:
- 3.2-ALPHA-2
-
set
Sets a new value to this object. This method fires a property change event associated toPROP_VALUE.- Specified by:
setin interfaceChangeable<T>- Parameters:
value- the new value
-
get
Returns the value of this object.- Specified by:
getin interfaceChangingSource<T>- Returns:
- the value
-
bind
Binds this property to aChangingSource. Every change in the value of the source will be synchronized to the value of this property. If the source is aChangeablebinding will be bidirectional, that is the object will be set to the current value of this property and will be kept in sync.- Parameters:
source- the source
-
unbindAll
public void unbindAll()Removes all the bindings of this object.- Specified by:
unbindAllin interfaceChangingSource<T>
-