Package com.palantir.ptoss.cinch.core
Class WeakBindableModelSupport
java.lang.Object
com.palantir.ptoss.cinch.core.WeakBindableModelSupport
- All Implemented Interfaces:
BindableModel
A stand-alone implementation of
BindableModel
. Uses WeakReference
s to
attach bindings to models.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Attach the binding to the model.<T extends Enum<T> & ModelUpdate>
voidmodelUpdated
(T... changed) Alert the bindings that the model has updated with the specified change types.void
Removes the passed binding from this model.void
Removes all bindings from this model.void
update()
Shortcut call for a generic model update.
-
Constructor Details
-
WeakBindableModelSupport
public WeakBindableModelSupport()
-
-
Method Details
-
bind
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
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
Removes the passed binding from this model.- Specified by:
unbind
in interfaceBindableModel
-
unbindAll
public void unbindAll()Removes all bindings from this model.
-