Package com.palantir.ptoss.cinch.core
Class WeakBindableModelSupport
- java.lang.Object
-
- com.palantir.ptoss.cinch.core.WeakBindableModelSupport
-
- All Implemented Interfaces:
BindableModel
public class WeakBindableModelSupport extends java.lang.Object implements BindableModel
A stand-alone implementation ofBindableModel
. UsesWeakReference
s to attach bindings to models.
-
-
Constructor Summary
Constructors Constructor Description WeakBindableModelSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bind(Binding binding)
Attach the binding to the model.<T extends java.lang.Enum<T> & ModelUpdate>
voidmodelUpdated(T... changed)
Alert the bindings that the model has updated with the specified change types.void
unbind(Binding toUnbind)
Removes the passed binding from this model.void
unbindAll()
Removes all bindings from this model.void
update()
Shortcut call for a generic model update.
-
-
-
Method Detail
-
bind
public void bind(Binding binding)
Attach the binding to the model. Whenever the model is updated then the binding will be triggered.- Specified by:
bind
in interfaceBindableModel
-
update
public void update()
Shortcut call for a generic model update.
-
modelUpdated
public <T extends java.lang.Enum<T> & ModelUpdate> void modelUpdated(T... changed)
Alert the bindings that the model has updated with the specified change types.- Specified by:
modelUpdated
in interfaceBindableModel
- Parameters:
changed
- list of change types to indicate
-
unbind
public void unbind(Binding toUnbind)
Removes the passed binding from this model.- Specified by:
unbind
in interfaceBindableModel
-
unbindAll
public void unbindAll()
Removes all bindings from this model.
-
-