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. UsesWeakReferences to attach bindings to models.
-
-
Constructor Summary
Constructors Constructor Description WeakBindableModelSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbind(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.voidunbind(Binding toUnbind)Removes the passed binding from this model.voidunbindAll()Removes all bindings from this model.voidupdate()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:
bindin 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:
modelUpdatedin interfaceBindableModel- Parameters:
changed- list of change types to indicate
-
unbind
public void unbind(Binding toUnbind)
Removes the passed binding from this model.- Specified by:
unbindin interfaceBindableModel
-
unbindAll
public void unbindAll()
Removes all bindings from this model.
-
-